blob: 5b9aa18619a318cc787800ef6c5570a25eb826be [file] [log] [blame]
Junio C Hamanob96f40a2024-08-01 00:57:251<!DOCTYPE html>
2<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
3<head>
4<meta charset="UTF-8"/>
5<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
6<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
7<meta name="generator" content="Asciidoctor 2.0.20"/>
8<title>git-diff-tree(1)</title>
9<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"/>
10<style>
11/*! Asciidoctor default stylesheet | MIT License | https://asciidoctor.org */
12/* Uncomment the following line when using as a custom stylesheet */
13/* @import "https://fonts.googleapis.com/css?family=Open+Sans:300,300italic,400,400italic,600,600italic%7CNoto+Serif:400,400italic,700,700italic%7CDroid+Sans+Mono:400,700"; */
14html{font-family:sans-serif;-webkit-text-size-adjust:100%}
15a{background:none}
16a:focus{outline:thin dotted}
17a:active,a:hover{outline:0}
18h1{font-size:2em;margin:.67em 0}
19b,strong{font-weight:bold}
20abbr{font-size:.9em}
21abbr[title]{cursor:help;border-bottom:1px dotted #dddddf;text-decoration:none}
22dfn{font-style:italic}
23hr{height:0}
24mark{background:#ff0;color:#000}
25code,kbd,pre,samp{font-family:monospace;font-size:1em}
26pre{white-space:pre-wrap}
27q{quotes:"\201C" "\201D" "\2018" "\2019"}
28small{font-size:80%}
29sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}
30sup{top:-.5em}
31sub{bottom:-.25em}
32img{border:0}
33svg:not(:root){overflow:hidden}
34figure{margin:0}
35audio,video{display:inline-block}
36audio:not([controls]){display:none;height:0}
37fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}
38legend{border:0;padding:0}
39button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}
40button,input{line-height:normal}
41button,select{text-transform:none}
42button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}
43button[disabled],html input[disabled]{cursor:default}
44input[type=checkbox],input[type=radio]{padding:0}
45button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}
46textarea{overflow:auto;vertical-align:top}
47table{border-collapse:collapse;border-spacing:0}
48*,::before,::after{box-sizing:border-box}
49html,body{font-size:100%}
50body{background:#fff;color:rgba(0,0,0,.8);padding:0;margin:0;font-family:"Noto Serif","DejaVu Serif",serif;line-height:1;position:relative;cursor:auto;-moz-tab-size:4;-o-tab-size:4;tab-size:4;word-wrap:anywhere;-moz-osx-font-smoothing:grayscale;-webkit-font-smoothing:antialiased}
51a:hover{cursor:pointer}
52img,object,embed{max-width:100%;height:auto}
53object,embed{height:100%}
54img{-ms-interpolation-mode:bicubic}
55.left{float:left!important}
56.right{float:right!important}
57.text-left{text-align:left!important}
58.text-right{text-align:right!important}
59.text-center{text-align:center!important}
60.text-justify{text-align:justify!important}
61.hide{display:none}
62img,object,svg{display:inline-block;vertical-align:middle}
63textarea{height:auto;min-height:50px}
64select{width:100%}
65.subheader,.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{line-height:1.45;color:#7a2518;font-weight:400;margin-top:0;margin-bottom:.25em}
66div,dl,dt,dd,ul,ol,li,h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6,pre,form,p,blockquote,th,td{margin:0;padding:0}
67a{color:#2156a5;text-decoration:underline;line-height:inherit}
68a:hover,a:focus{color:#1d4b8f}
69a img{border:0}
70p{line-height:1.6;margin-bottom:1.25em;text-rendering:optimizeLegibility}
71p aside{font-size:.875em;line-height:1.35;font-style:italic}
72h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{font-family:"Open Sans","DejaVu Sans",sans-serif;font-weight:300;font-style:normal;color:#ba3925;text-rendering:optimizeLegibility;margin-top:1em;margin-bottom:.5em;line-height:1.0125em}
73h1 small,h2 small,h3 small,#toctitle small,.sidebarblock>.content>.title small,h4 small,h5 small,h6 small{font-size:60%;color:#e99b8f;line-height:0}
74h1{font-size:2.125em}
75h2{font-size:1.6875em}
76h3,#toctitle,.sidebarblock>.content>.title{font-size:1.375em}
77h4,h5{font-size:1.125em}
78h6{font-size:1em}
79hr{border:solid #dddddf;border-width:1px 0 0;clear:both;margin:1.25em 0 1.1875em}
80em,i{font-style:italic;line-height:inherit}
81strong,b{font-weight:bold;line-height:inherit}
82small{font-size:60%;line-height:inherit}
83code{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;font-weight:400;color:rgba(0,0,0,.9)}
84ul,ol,dl{line-height:1.6;margin-bottom:1.25em;list-style-position:outside;font-family:inherit}
85ul,ol{margin-left:1.5em}
86ul li ul,ul li ol{margin-left:1.25em;margin-bottom:0}
87ul.circle{list-style-type:circle}
88ul.disc{list-style-type:disc}
89ul.square{list-style-type:square}
90ul.circle ul:not([class]),ul.disc ul:not([class]),ul.square ul:not([class]){list-style:inherit}
91ol li ul,ol li ol{margin-left:1.25em;margin-bottom:0}
92dl dt{margin-bottom:.3125em;font-weight:bold}
93dl dd{margin-bottom:1.25em}
94blockquote{margin:0 0 1.25em;padding:.5625em 1.25em 0 1.1875em;border-left:1px solid #ddd}
95blockquote,blockquote p{line-height:1.6;color:rgba(0,0,0,.85)}
96@media screen and (min-width:768px){h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2}
97h1{font-size:2.75em}
98h2{font-size:2.3125em}
99h3,#toctitle,.sidebarblock>.content>.title{font-size:1.6875em}
100h4{font-size:1.4375em}}
101table{background:#fff;margin-bottom:1.25em;border:1px solid #dedede;word-wrap:normal}
102table thead,table tfoot{background:#f7f8f7}
103table thead tr th,table thead tr td,table tfoot tr th,table tfoot tr td{padding:.5em .625em .625em;font-size:inherit;color:rgba(0,0,0,.8);text-align:left}
104table tr th,table tr td{padding:.5625em .625em;font-size:inherit;color:rgba(0,0,0,.8)}
105table tr.even,table tr.alt{background:#f8f8f7}
106table thead tr th,table tfoot tr th,table tbody tr td,table tr td,table tfoot tr td{line-height:1.6}
107h1,h2,h3,#toctitle,.sidebarblock>.content>.title,h4,h5,h6{line-height:1.2;word-spacing:-.05em}
108h1 strong,h2 strong,h3 strong,#toctitle strong,.sidebarblock>.content>.title strong,h4 strong,h5 strong,h6 strong{font-weight:400}
109.center{margin-left:auto;margin-right:auto}
110.stretch{width:100%}
111.clearfix::before,.clearfix::after,.float-group::before,.float-group::after{content:" ";display:table}
112.clearfix::after,.float-group::after{clear:both}
113:not(pre).nobreak{word-wrap:normal}
114:not(pre).nowrap{white-space:nowrap}
115:not(pre).pre-wrap{white-space:pre-wrap}
116:not(pre):not([class^=L])>code{font-size:.9375em;font-style:normal!important;letter-spacing:0;padding:.1em .5ex;word-spacing:-.15em;background:#f7f7f8;border-radius:4px;line-height:1.45;text-rendering:optimizeSpeed}
117pre{color:rgba(0,0,0,.9);font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;line-height:1.45;text-rendering:optimizeSpeed}
118pre code,pre pre{color:inherit;font-size:inherit;line-height:inherit}
119pre>code{display:block}
120pre.nowrap,pre.nowrap pre{white-space:pre;word-wrap:normal}
121em em{font-style:normal}
122strong strong{font-weight:400}
123.keyseq{color:rgba(51,51,51,.8)}
124kbd{font-family:"Droid Sans Mono","DejaVu Sans Mono",monospace;display:inline-block;color:rgba(0,0,0,.8);font-size:.65em;line-height:1.45;background:#f7f7f7;border:1px solid #ccc;border-radius:3px;box-shadow:0 1px 0 rgba(0,0,0,.2),inset 0 0 0 .1em #fff;margin:0 .15em;padding:.2em .5em;vertical-align:middle;position:relative;top:-.1em;white-space:nowrap}
125.keyseq kbd:first-child{margin-left:0}
126.keyseq kbd:last-child{margin-right:0}
127.menuseq,.menuref{color:#000}
128.menuseq b:not(.caret),.menuref{font-weight:inherit}
129.menuseq{word-spacing:-.02em}
130.menuseq b.caret{font-size:1.25em;line-height:.8}
131.menuseq i.caret{font-weight:bold;text-align:center;width:.45em}
132b.button::before,b.button::after{position:relative;top:-1px;font-weight:400}
133b.button::before{content:"[";padding:0 3px 0 2px}
134b.button::after{content:"]";padding:0 2px 0 3px}
135p a>code:hover{color:rgba(0,0,0,.9)}
136#header,#content,#footnotes,#footer{width:100%;margin:0 auto;max-width:62.5em;*zoom:1;position:relative;padding-left:.9375em;padding-right:.9375em}
137#header::before,#header::after,#content::before,#content::after,#footnotes::before,#footnotes::after,#footer::before,#footer::after{content:" ";display:table}
138#header::after,#content::after,#footnotes::after,#footer::after{clear:both}
139#content{margin-top:1.25em}
140#content::before{content:none}
141#header>h1:first-child{color:rgba(0,0,0,.85);margin-top:2.25rem;margin-bottom:0}
142#header>h1:first-child+#toc{margin-top:8px;border-top:1px solid #dddddf}
143#header>h1:only-child,body.toc2 #header>h1:nth-last-child(2){border-bottom:1px solid #dddddf;padding-bottom:8px}
144#header .details{border-bottom:1px solid #dddddf;line-height:1.45;padding-top:.25em;padding-bottom:.25em;padding-left:.25em;color:rgba(0,0,0,.6);display:flex;flex-flow:row wrap}
145#header .details span:first-child{margin-left:-.125em}
146#header .details span.email a{color:rgba(0,0,0,.85)}
147#header .details br{display:none}
148#header .details br+span::before{content:"\00a0\2013\00a0"}
149#header .details br+span.author::before{content:"\00a0\22c5\00a0";color:rgba(0,0,0,.85)}
150#header .details br+span#revremark::before{content:"\00a0|\00a0"}
151#header #revnumber{text-transform:capitalize}
152#header #revnumber::after{content:"\00a0"}
153#content>h1:first-child:not([class]){color:rgba(0,0,0,.85);border-bottom:1px solid #dddddf;padding-bottom:8px;margin-top:0;padding-top:1rem;margin-bottom:1.25rem}
154#toc{border-bottom:1px solid #e7e7e9;padding-bottom:.5em}
155#toc>ul{margin-left:.125em}
156#toc ul.sectlevel0>li>a{font-style:italic}
157#toc ul.sectlevel0 ul.sectlevel1{margin:.5em 0}
158#toc ul{font-family:"Open Sans","DejaVu Sans",sans-serif;list-style-type:none}
159#toc li{line-height:1.3334;margin-top:.3334em}
160#toc a{text-decoration:none}
161#toc a:active{text-decoration:underline}
162#toctitle{color:#7a2518;font-size:1.2em}
163@media screen and (min-width:768px){#toctitle{font-size:1.375em}
164body.toc2{padding-left:15em;padding-right:0}
165#toc.toc2{margin-top:0!important;background:#f8f8f7;position:fixed;width:15em;left:0;top:0;border-right:1px solid #e7e7e9;border-top-width:0!important;border-bottom-width:0!important;z-index:1000;padding:1.25em 1em;height:100%;overflow:auto}
166#toc.toc2 #toctitle{margin-top:0;margin-bottom:.8rem;font-size:1.2em}
167#toc.toc2>ul{font-size:.9em;margin-bottom:0}
168#toc.toc2 ul ul{margin-left:0;padding-left:1em}
169#toc.toc2 ul.sectlevel0 ul.sectlevel1{padding-left:0;margin-top:.5em;margin-bottom:.5em}
170body.toc2.toc-right{padding-left:0;padding-right:15em}
171body.toc2.toc-right #toc.toc2{border-right-width:0;border-left:1px solid #e7e7e9;left:auto;right:0}}
172@media screen and (min-width:1280px){body.toc2{padding-left:20em;padding-right:0}
173#toc.toc2{width:20em}
174#toc.toc2 #toctitle{font-size:1.375em}
175#toc.toc2>ul{font-size:.95em}
176#toc.toc2 ul ul{padding-left:1.25em}
177body.toc2.toc-right{padding-left:0;padding-right:20em}}
178#content #toc{border:1px solid #e0e0dc;margin-bottom:1.25em;padding:1.25em;background:#f8f8f7;border-radius:4px}
179#content #toc>:first-child{margin-top:0}
180#content #toc>:last-child{margin-bottom:0}
181#footer{max-width:none;background:rgba(0,0,0,.8);padding:1.25em}
182#footer-text{color:hsla(0,0%,100%,.8);line-height:1.44}
183#content{margin-bottom:.625em}
184.sect1{padding-bottom:.625em}
185@media screen and (min-width:768px){#content{margin-bottom:1.25em}
186.sect1{padding-bottom:1.25em}}
187.sect1:last-child{padding-bottom:0}
188.sect1+.sect1{border-top:1px solid #e7e7e9}
189#content h1>a.anchor,h2>a.anchor,h3>a.anchor,#toctitle>a.anchor,.sidebarblock>.content>.title>a.anchor,h4>a.anchor,h5>a.anchor,h6>a.anchor{position:absolute;z-index:1001;width:1.5ex;margin-left:-1.5ex;display:block;text-decoration:none!important;visibility:hidden;text-align:center;font-weight:400}
190#content h1>a.anchor::before,h2>a.anchor::before,h3>a.anchor::before,#toctitle>a.anchor::before,.sidebarblock>.content>.title>a.anchor::before,h4>a.anchor::before,h5>a.anchor::before,h6>a.anchor::before{content:"\00A7";font-size:.85em;display:block;padding-top:.1em}
191#content h1:hover>a.anchor,#content h1>a.anchor:hover,h2:hover>a.anchor,h2>a.anchor:hover,h3:hover>a.anchor,#toctitle:hover>a.anchor,.sidebarblock>.content>.title:hover>a.anchor,h3>a.anchor:hover,#toctitle>a.anchor:hover,.sidebarblock>.content>.title>a.anchor:hover,h4:hover>a.anchor,h4>a.anchor:hover,h5:hover>a.anchor,h5>a.anchor:hover,h6:hover>a.anchor,h6>a.anchor:hover{visibility:visible}
192#content h1>a.link,h2>a.link,h3>a.link,#toctitle>a.link,.sidebarblock>.content>.title>a.link,h4>a.link,h5>a.link,h6>a.link{color:#ba3925;text-decoration:none}
193#content h1>a.link:hover,h2>a.link:hover,h3>a.link:hover,#toctitle>a.link:hover,.sidebarblock>.content>.title>a.link:hover,h4>a.link:hover,h5>a.link:hover,h6>a.link:hover{color:#a53221}
194details,.audioblock,.imageblock,.literalblock,.listingblock,.stemblock,.videoblock{margin-bottom:1.25em}
195details{margin-left:1.25rem}
196details>summary{cursor:pointer;display:block;position:relative;line-height:1.6;margin-bottom:.625rem;outline:none;-webkit-tap-highlight-color:transparent}
197details>summary::-webkit-details-marker{display:none}
198details>summary::before{content:"";border:solid transparent;border-left:solid;border-width:.3em 0 .3em .5em;position:absolute;top:.5em;left:-1.25rem;transform:translateX(15%)}
199details[open]>summary::before{border:solid transparent;border-top:solid;border-width:.5em .3em 0;transform:translateY(15%)}
200details>summary::after{content:"";width:1.25rem;height:1em;position:absolute;top:.3em;left:-1.25rem}
201.admonitionblock td.content>.title,.audioblock>.title,.exampleblock>.title,.imageblock>.title,.listingblock>.title,.literalblock>.title,.stemblock>.title,.openblock>.title,.paragraph>.title,.quoteblock>.title,table.tableblock>.title,.verseblock>.title,.videoblock>.title,.dlist>.title,.olist>.title,.ulist>.title,.qlist>.title,.hdlist>.title{text-rendering:optimizeLegibility;text-align:left;font-family:"Noto Serif","DejaVu Serif",serif;font-size:1rem;font-style:italic}
202table.tableblock.fit-content>caption.title{white-space:nowrap;width:0}
203.paragraph.lead>p,#preamble>.sectionbody>[class=paragraph]:first-of-type p{font-size:1.21875em;line-height:1.6;color:rgba(0,0,0,.85)}
204.admonitionblock>table{border-collapse:separate;border:0;background:none;width:100%}
205.admonitionblock>table td.icon{text-align:center;width:80px}
206.admonitionblock>table td.icon img{max-width:none}
207.admonitionblock>table td.icon .title{font-weight:bold;font-family:"Open Sans","DejaVu Sans",sans-serif;text-transform:uppercase}
208.admonitionblock>table td.content{padding-left:1.125em;padding-right:1.25em;border-left:1px solid #dddddf;color:rgba(0,0,0,.6);word-wrap:anywhere}
209.admonitionblock>table td.content>:last-child>:last-child{margin-bottom:0}
210.exampleblock>.content{border:1px solid #e6e6e6;margin-bottom:1.25em;padding:1.25em;background:#fff;border-radius:4px}
211.sidebarblock{border:1px solid #dbdbd6;margin-bottom:1.25em;padding:1.25em;background:#f3f3f2;border-radius:4px}
212.sidebarblock>.content>.title{color:#7a2518;margin-top:0;text-align:center}
213.exampleblock>.content>:first-child,.sidebarblock>.content>:first-child{margin-top:0}
214.exampleblock>.content>:last-child,.exampleblock>.content>:last-child>:last-child,.exampleblock>.content .olist>ol>li:last-child>:last-child,.exampleblock>.content .ulist>ul>li:last-child>:last-child,.exampleblock>.content .qlist>ol>li:last-child>:last-child,.sidebarblock>.content>:last-child,.sidebarblock>.content>:last-child>:last-child,.sidebarblock>.content .olist>ol>li:last-child>:last-child,.sidebarblock>.content .ulist>ul>li:last-child>:last-child,.sidebarblock>.content .qlist>ol>li:last-child>:last-child{margin-bottom:0}
215.literalblock pre,.listingblock>.content>pre{border-radius:4px;overflow-x:auto;padding:1em;font-size:.8125em}
216@media screen and (min-width:768px){.literalblock pre,.listingblock>.content>pre{font-size:.90625em}}
217@media screen and (min-width:1280px){.literalblock pre,.listingblock>.content>pre{font-size:1em}}
218.literalblock pre,.listingblock>.content>pre:not(.highlight),.listingblock>.content>pre[class=highlight],.listingblock>.content>pre[class^="highlight "]{background:#f7f7f8}
219.literalblock.output pre{color:#f7f7f8;background:rgba(0,0,0,.9)}
220.listingblock>.content{position:relative}
221.listingblock code[data-lang]::before{display:none;content:attr(data-lang);position:absolute;font-size:.75em;top:.425rem;right:.5rem;line-height:1;text-transform:uppercase;color:inherit;opacity:.5}
222.listingblock:hover code[data-lang]::before{display:block}
223.listingblock.terminal pre .command::before{content:attr(data-prompt);padding-right:.5em;color:inherit;opacity:.5}
224.listingblock.terminal pre .command:not([data-prompt])::before{content:"$"}
225.listingblock pre.highlightjs{padding:0}
226.listingblock pre.highlightjs>code{padding:1em;border-radius:4px}
227.listingblock pre.prettyprint{border-width:0}
228.prettyprint{background:#f7f7f8}
229pre.prettyprint .linenums{line-height:1.45;margin-left:2em}
230pre.prettyprint li{background:none;list-style-type:inherit;padding-left:0}
231pre.prettyprint li code[data-lang]::before{opacity:1}
232pre.prettyprint li:not(:first-child) code[data-lang]::before{display:none}
233table.linenotable{border-collapse:separate;border:0;margin-bottom:0;background:none}
234table.linenotable td[class]{color:inherit;vertical-align:top;padding:0;line-height:inherit;white-space:normal}
235table.linenotable td.code{padding-left:.75em}
236table.linenotable td.linenos,pre.pygments .linenos{border-right:1px solid;opacity:.35;padding-right:.5em;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}
237pre.pygments span.linenos{display:inline-block;margin-right:.75em}
238.quoteblock{margin:0 1em 1.25em 1.5em;display:table}
239.quoteblock:not(.excerpt)>.title{margin-left:-1.5em;margin-bottom:.75em}
240.quoteblock blockquote,.quoteblock p{color:rgba(0,0,0,.85);font-size:1.15rem;line-height:1.75;word-spacing:.1em;letter-spacing:0;font-style:italic;text-align:justify}
241.quoteblock blockquote{margin:0;padding:0;border:0}
242.quoteblock blockquote::before{content:"\201c";float:left;font-size:2.75em;font-weight:bold;line-height:.6em;margin-left:-.6em;color:#7a2518;text-shadow:0 1px 2px rgba(0,0,0,.1)}
243.quoteblock blockquote>.paragraph:last-child p{margin-bottom:0}
244.quoteblock .attribution{margin-top:.75em;margin-right:.5ex;text-align:right}
245.verseblock{margin:0 1em 1.25em}
246.verseblock pre{font-family:"Open Sans","DejaVu Sans",sans-serif;font-size:1.15rem;color:rgba(0,0,0,.85);font-weight:300;text-rendering:optimizeLegibility}
247.verseblock pre strong{font-weight:400}
248.verseblock .attribution{margin-top:1.25rem;margin-left:.5ex}
249.quoteblock .attribution,.verseblock .attribution{font-size:.9375em;line-height:1.45;font-style:italic}
250.quoteblock .attribution br,.verseblock .attribution br{display:none}
251.quoteblock .attribution cite,.verseblock .attribution cite{display:block;letter-spacing:-.025em;color:rgba(0,0,0,.6)}
252.quoteblock.abstract blockquote::before,.quoteblock.excerpt blockquote::before,.quoteblock .quoteblock blockquote::before{display:none}
253.quoteblock.abstract blockquote,.quoteblock.abstract p,.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{line-height:1.6;word-spacing:0}
254.quoteblock.abstract{margin:0 1em 1.25em;display:block}
255.quoteblock.abstract>.title{margin:0 0 .375em;font-size:1.15em;text-align:center}
256.quoteblock.excerpt>blockquote,.quoteblock .quoteblock{padding:0 0 .25em 1em;border-left:.25em solid #dddddf}
257.quoteblock.excerpt,.quoteblock .quoteblock{margin-left:0}
258.quoteblock.excerpt blockquote,.quoteblock.excerpt p,.quoteblock .quoteblock blockquote,.quoteblock .quoteblock p{color:inherit;font-size:1.0625rem}
259.quoteblock.excerpt .attribution,.quoteblock .quoteblock .attribution{color:inherit;font-size:.85rem;text-align:left;margin-right:0}
260p.tableblock:last-child{margin-bottom:0}
261td.tableblock>.content{margin-bottom:1.25em;word-wrap:anywhere}
262td.tableblock>.content>:last-child{margin-bottom:-1.25em}
263table.tableblock,th.tableblock,td.tableblock{border:0 solid #dedede}
264table.grid-all>*>tr>*{border-width:1px}
265table.grid-cols>*>tr>*{border-width:0 1px}
266table.grid-rows>*>tr>*{border-width:1px 0}
267table.frame-all{border-width:1px}
268table.frame-ends{border-width:1px 0}
269table.frame-sides{border-width:0 1px}
270table.frame-none>colgroup+*>:first-child>*,table.frame-sides>colgroup+*>:first-child>*{border-top-width:0}
271table.frame-none>:last-child>:last-child>*,table.frame-sides>:last-child>:last-child>*{border-bottom-width:0}
272table.frame-none>*>tr>:first-child,table.frame-ends>*>tr>:first-child{border-left-width:0}
273table.frame-none>*>tr>:last-child,table.frame-ends>*>tr>:last-child{border-right-width:0}
274table.stripes-all>*>tr,table.stripes-odd>*>tr:nth-of-type(odd),table.stripes-even>*>tr:nth-of-type(even),table.stripes-hover>*>tr:hover{background:#f8f8f7}
275th.halign-left,td.halign-left{text-align:left}
276th.halign-right,td.halign-right{text-align:right}
277th.halign-center,td.halign-center{text-align:center}
278th.valign-top,td.valign-top{vertical-align:top}
279th.valign-bottom,td.valign-bottom{vertical-align:bottom}
280th.valign-middle,td.valign-middle{vertical-align:middle}
281table thead th,table tfoot th{font-weight:bold}
282tbody tr th{background:#f7f8f7}
283tbody tr th,tbody tr th p,tfoot tr th,tfoot tr th p{color:rgba(0,0,0,.8);font-weight:bold}
284p.tableblock>code:only-child{background:none;padding:0}
285p.tableblock{font-size:1em}
286ol{margin-left:1.75em}
287ul li ol{margin-left:1.5em}
288dl dd{margin-left:1.125em}
289dl dd:last-child,dl dd:last-child>:last-child{margin-bottom:0}
290li p,ul dd,ol dd,.olist .olist,.ulist .ulist,.ulist .olist,.olist .ulist{margin-bottom:.625em}
291ul.checklist,ul.none,ol.none,ul.no-bullet,ol.no-bullet,ol.unnumbered,ul.unstyled,ol.unstyled{list-style-type:none}
292ul.no-bullet,ol.no-bullet,ol.unnumbered{margin-left:.625em}
293ul.unstyled,ol.unstyled{margin-left:0}
294li>p:empty:only-child::before{content:"";display:inline-block}
295ul.checklist>li>p:first-child{margin-left:-1em}
296ul.checklist>li>p:first-child>.fa-square-o:first-child,ul.checklist>li>p:first-child>.fa-check-square-o:first-child{width:1.25em;font-size:.8em;position:relative;bottom:.125em}
297ul.checklist>li>p:first-child>input[type=checkbox]:first-child{margin-right:.25em}
298ul.inline{display:flex;flex-flow:row wrap;list-style:none;margin:0 0 .625em -1.25em}
299ul.inline>li{margin-left:1.25em}
300.unstyled dl dt{font-weight:400;font-style:normal}
301ol.arabic{list-style-type:decimal}
302ol.decimal{list-style-type:decimal-leading-zero}
303ol.loweralpha{list-style-type:lower-alpha}
304ol.upperalpha{list-style-type:upper-alpha}
305ol.lowerroman{list-style-type:lower-roman}
306ol.upperroman{list-style-type:upper-roman}
307ol.lowergreek{list-style-type:lower-greek}
308.hdlist>table,.colist>table{border:0;background:none}
309.hdlist>table>tbody>tr,.colist>table>tbody>tr{background:none}
310td.hdlist1,td.hdlist2{vertical-align:top;padding:0 .625em}
311td.hdlist1{font-weight:bold;padding-bottom:1.25em}
312td.hdlist2{word-wrap:anywhere}
313.literalblock+.colist,.listingblock+.colist{margin-top:-.5em}
314.colist td:not([class]):first-child{padding:.4em .75em 0;line-height:1;vertical-align:top}
315.colist td:not([class]):first-child img{max-width:none}
316.colist td:not([class]):last-child{padding:.25em 0}
317.thumb,.th{line-height:0;display:inline-block;border:4px solid #fff;box-shadow:0 0 0 1px #ddd}
318.imageblock.left{margin:.25em .625em 1.25em 0}
319.imageblock.right{margin:.25em 0 1.25em .625em}
320.imageblock>.title{margin-bottom:0}
321.imageblock.thumb,.imageblock.th{border-width:6px}
322.imageblock.thumb>.title,.imageblock.th>.title{padding:0 .125em}
323.image.left,.image.right{margin-top:.25em;margin-bottom:.25em;display:inline-block;line-height:0}
324.image.left{margin-right:.625em}
325.image.right{margin-left:.625em}
326a.image{text-decoration:none;display:inline-block}
327a.image object{pointer-events:none}
328sup.footnote,sup.footnoteref{font-size:.875em;position:static;vertical-align:super}
329sup.footnote a,sup.footnoteref a{text-decoration:none}
330sup.footnote a:active,sup.footnoteref a:active{text-decoration:underline}
331#footnotes{padding-top:.75em;padding-bottom:.75em;margin-bottom:.625em}
332#footnotes hr{width:20%;min-width:6.25em;margin:-.25em 0 .75em;border-width:1px 0 0}
333#footnotes .footnote{padding:0 .375em 0 .225em;line-height:1.3334;font-size:.875em;margin-left:1.2em;margin-bottom:.2em}
334#footnotes .footnote a:first-of-type{font-weight:bold;text-decoration:none;margin-left:-1.05em}
335#footnotes .footnote:last-of-type{margin-bottom:0}
336#content #footnotes{margin-top:-.625em;margin-bottom:0;padding:.75em 0}
337div.unbreakable{page-break-inside:avoid}
338.big{font-size:larger}
339.small{font-size:smaller}
340.underline{text-decoration:underline}
341.overline{text-decoration:overline}
342.line-through{text-decoration:line-through}
343.aqua{color:#00bfbf}
344.aqua-background{background:#00fafa}
345.black{color:#000}
346.black-background{background:#000}
347.blue{color:#0000bf}
348.blue-background{background:#0000fa}
349.fuchsia{color:#bf00bf}
350.fuchsia-background{background:#fa00fa}
351.gray{color:#606060}
352.gray-background{background:#7d7d7d}
353.green{color:#006000}
354.green-background{background:#007d00}
355.lime{color:#00bf00}
356.lime-background{background:#00fa00}
357.maroon{color:#600000}
358.maroon-background{background:#7d0000}
359.navy{color:#000060}
360.navy-background{background:#00007d}
361.olive{color:#606000}
362.olive-background{background:#7d7d00}
363.purple{color:#600060}
364.purple-background{background:#7d007d}
365.red{color:#bf0000}
366.red-background{background:#fa0000}
367.silver{color:#909090}
368.silver-background{background:#bcbcbc}
369.teal{color:#006060}
370.teal-background{background:#007d7d}
371.white{color:#bfbfbf}
372.white-background{background:#fafafa}
373.yellow{color:#bfbf00}
374.yellow-background{background:#fafa00}
375span.icon>.fa{cursor:default}
376a span.icon>.fa{cursor:inherit}
377.admonitionblock td.icon [class^="fa icon-"]{font-size:2.5em;text-shadow:1px 1px 2px rgba(0,0,0,.5);cursor:default}
378.admonitionblock td.icon .icon-note::before{content:"\f05a";color:#19407c}
379.admonitionblock td.icon .icon-tip::before{content:"\f0eb";text-shadow:1px 1px 2px rgba(155,155,0,.8);color:#111}
380.admonitionblock td.icon .icon-warning::before{content:"\f071";color:#bf6900}
381.admonitionblock td.icon .icon-caution::before{content:"\f06d";color:#bf3400}
382.admonitionblock td.icon .icon-important::before{content:"\f06a";color:#bf0000}
383.conum[data-value]{display:inline-block;color:#fff!important;background:rgba(0,0,0,.8);border-radius:50%;text-align:center;font-size:.75em;width:1.67em;height:1.67em;line-height:1.67em;font-family:"Open Sans","DejaVu Sans",sans-serif;font-style:normal;font-weight:bold}
384.conum[data-value] *{color:#fff!important}
385.conum[data-value]+b{display:none}
386.conum[data-value]::after{content:attr(data-value)}
387pre .conum[data-value]{position:relative;top:-.125em}
388b.conum *{color:inherit!important}
389.conum:not([data-value]):empty{display:none}
390dt,th.tableblock,td.content,div.footnote{text-rendering:optimizeLegibility}
391h1,h2,p,td.content,span.alt,summary{letter-spacing:-.01em}
392p strong,td.content strong,div.footnote strong{letter-spacing:-.005em}
393p,blockquote,dt,td.content,td.hdlist1,span.alt,summary{font-size:1.0625rem}
394p{margin-bottom:1.25rem}
395.sidebarblock p,.sidebarblock dt,.sidebarblock td.content,p.tableblock{font-size:1em}
396.exampleblock>.content{background:#fffef7;border-color:#e0e0dc;box-shadow:0 1px 4px #e0e0dc}
397.print-only{display:none!important}
398@page{margin:1.25cm .75cm}
399@media print{*{box-shadow:none!important;text-shadow:none!important}
400html{font-size:80%}
401a{color:inherit!important;text-decoration:underline!important}
402a.bare,a[href^="#"],a[href^="mailto:"]{text-decoration:none!important}
403a[href^="http:"]:not(.bare)::after,a[href^="https:"]:not(.bare)::after{content:"(" attr(href) ")";display:inline-block;font-size:.875em;padding-left:.25em}
404abbr[title]{border-bottom:1px dotted}
405abbr[title]::after{content:" (" attr(title) ")"}
406pre,blockquote,tr,img,object,svg{page-break-inside:avoid}
407thead{display:table-header-group}
408svg{max-width:100%}
409p,blockquote,dt,td.content{font-size:1em;orphans:3;widows:3}
410h2,h3,#toctitle,.sidebarblock>.content>.title{page-break-after:avoid}
411#header,#content,#footnotes,#footer{max-width:none}
412#toc,.sidebarblock,.exampleblock>.content{background:none!important}
413#toc{border-bottom:1px solid #dddddf!important;padding-bottom:0!important}
414body.book #header{text-align:center}
415body.book #header>h1:first-child{border:0!important;margin:2.5em 0 1em}
416body.book #header .details{border:0!important;display:block;padding:0!important}
417body.book #header .details span:first-child{margin-left:0!important}
418body.book #header .details br{display:block}
419body.book #header .details br+span::before{content:none!important}
420body.book #toc{border:0!important;text-align:left!important;padding:0!important;margin:0!important}
421body.book #toc,body.book #preamble,body.book h1.sect0,body.book .sect1>h2{page-break-before:always}
422.listingblock code[data-lang]::before{display:block}
423#footer{padding:0 .9375em}
424.hide-on-print{display:none!important}
425.print-only{display:block!important}
426.hide-for-print{display:none!important}
427.show-for-print{display:inherit!important}}
428@media amzn-kf8,print{#header>h1:first-child{margin-top:1.25rem}
429.sect1{padding:0!important}
430.sect1+.sect1{border:0}
431#footer{background:none}
432#footer-text{color:rgba(0,0,0,.6);font-size:.9em}}
433@media amzn-kf8{#header,#content,#footnotes,#footer{padding:0}}
434</style>
435<style>
436pre>code {
437 display: inline;
438}
439</style>
440</head>
441<body class="manpage">
442<div id="header">
443<h1>git-diff-tree(1) Manual Page</h1>
444<h2 id="_name">NAME</h2>
445<div class="sectionbody">
446<p>git-diff-tree - Compares the content and mode of blobs found via two tree objects</p>
447</div>
448</div>
449<div id="content">
450<div class="sect1">
451<h2 id="_synopsis">SYNOPSIS</h2>
452<div class="sectionbody">
453<div class="verseblock">
454<pre class="content"><em>git diff-tree</em> [--stdin] [-m] [-s] [-v] [--no-commit-id] [--pretty]
455 [-t] [-r] [-c | --cc] [--combined-all-paths] [--root] [--merge-base]
456 [&lt;common-diff-options&gt;] &lt;tree-ish&gt; [&lt;tree-ish&gt;] [&lt;path&gt;&#8230;&#8203;]</pre>
457</div>
458</div>
459</div>
460<div class="sect1">
461<h2 id="_description">DESCRIPTION</h2>
462<div class="sectionbody">
463<div class="paragraph">
464<p>Compare the content and mode of blobs found via two tree objects.</p>
465</div>
466<div class="paragraph">
467<p>If there is only one &lt;tree-ish&gt; given, the commit is compared with its parents
468(see --stdin below).</p>
469</div>
470<div class="paragraph">
471<p>Note that <em>git diff-tree</em> can use the tree encapsulated in a commit object.</p>
472</div>
473</div>
474</div>
475<div class="sect1">
476<h2 id="_options">OPTIONS</h2>
477<div class="sectionbody">
478<div class="dlist">
479<dl>
480<dt class="hdlist1">-p</dt>
481<dt class="hdlist1">-u</dt>
482<dt class="hdlist1">--patch</dt>
483<dd>
484<p>Generate patch (see <a href="#generate_patch_text_with_p">Generating patch text with -p</a>).</p>
485</dd>
486<dt class="hdlist1">-s</dt>
487<dt class="hdlist1">--no-patch</dt>
488<dd>
489<p>Suppress all output from the diff machinery. Useful for
490commands like <code>git show</code> that show the patch by default to
491squelch their output, or to cancel the effect of options like
492<code>--patch</code>, <code>--stat</code> earlier on the command line in an alias.</p>
493</dd>
494<dt class="hdlist1">-U&lt;n&gt;</dt>
495<dt class="hdlist1">--unified=&lt;n&gt;</dt>
496<dd>
497<p>Generate diffs with &lt;n&gt; lines of context instead of
498the usual three.
499Implies <code>--patch</code>.</p>
500</dd>
501<dt class="hdlist1">--output=&lt;file&gt;</dt>
502<dd>
503<p>Output to a specific file instead of stdout.</p>
504</dd>
505<dt class="hdlist1">--output-indicator-new=&lt;char&gt;</dt>
506<dt class="hdlist1">--output-indicator-old=&lt;char&gt;</dt>
507<dt class="hdlist1">--output-indicator-context=&lt;char&gt;</dt>
508<dd>
509<p>Specify the character used to indicate new, old or context
510lines in the generated patch. Normally they are <em>+</em>, <em>-</em> and
511' ' respectively.</p>
512</dd>
513<dt class="hdlist1">--raw</dt>
514<dd>
515<p>Generate the diff in raw format.
516This is the default.</p>
517</dd>
518<dt class="hdlist1">--patch-with-raw</dt>
519<dd>
520<p>Synonym for <code>-p --raw</code>.</p>
521</dd>
522<dt class="hdlist1">--indent-heuristic</dt>
523<dd>
524<p>Enable the heuristic that shifts diff hunk boundaries to make patches
525easier to read. This is the default.</p>
526</dd>
527<dt class="hdlist1">--no-indent-heuristic</dt>
528<dd>
529<p>Disable the indent heuristic.</p>
530</dd>
531<dt class="hdlist1">--minimal</dt>
532<dd>
533<p>Spend extra time to make sure the smallest possible
534diff is produced.</p>
535</dd>
536<dt class="hdlist1">--patience</dt>
537<dd>
538<p>Generate a diff using the "patience diff" algorithm.</p>
539</dd>
540<dt class="hdlist1">--histogram</dt>
541<dd>
542<p>Generate a diff using the "histogram diff" algorithm.</p>
543</dd>
544<dt class="hdlist1">--anchored=&lt;text&gt;</dt>
545<dd>
546<p>Generate a diff using the "anchored diff" algorithm.</p>
547<div class="paragraph">
548<p>This option may be specified more than once.</p>
549</div>
550<div class="paragraph">
551<p>If a line exists in both the source and destination, exists only once,
552and starts with this text, this algorithm attempts to prevent it from
553appearing as a deletion or addition in the output. It uses the "patience
554diff" algorithm internally.</p>
555</div>
556</dd>
557<dt class="hdlist1">--diff-algorithm={patience|minimal|histogram|myers}</dt>
558<dd>
559<p>Choose a diff algorithm. The variants are as follows:</p>
560<div class="openblock">
561<div class="content">
562<div class="dlist">
563<dl>
564<dt class="hdlist1"><code>default</code>, <code>myers</code></dt>
565<dd>
566<p>The basic greedy diff algorithm. Currently, this is the default.</p>
567</dd>
568<dt class="hdlist1"><code>minimal</code></dt>
569<dd>
570<p>Spend extra time to make sure the smallest possible diff is
571produced.</p>
572</dd>
573<dt class="hdlist1"><code>patience</code></dt>
574<dd>
575<p>Use "patience diff" algorithm when generating patches.</p>
576</dd>
577<dt class="hdlist1"><code>histogram</code></dt>
578<dd>
579<p>This algorithm extends the patience algorithm to "support
580low-occurrence common elements".</p>
581</dd>
582</dl>
583</div>
584</div>
585</div>
586<div class="paragraph">
587<p>For instance, if you configured the <code>diff.algorithm</code> variable to a
588non-default value and want to use the default one, then you
589have to use <code>--diff-algorithm=default</code> option.</p>
590</div>
591</dd>
592<dt class="hdlist1">--stat[=&lt;width&gt;[,&lt;name-width&gt;[,&lt;count&gt;]]]</dt>
593<dd>
594<p>Generate a diffstat. By default, as much space as necessary
595will be used for the filename part, and the rest for the graph
596part. Maximum width defaults to terminal width, or 80 columns
597if not connected to a terminal, and can be overridden by
598<code>&lt;width&gt;</code>. The width of the filename part can be limited by
599giving another width <code>&lt;name-width&gt;</code> after a comma or by setting
600<code>diff.statNameWidth=&lt;width&gt;</code>. The width of the graph part can be
601limited by using <code>--stat-graph-width=&lt;width&gt;</code> or by setting
602<code>diff.statGraphWidth=&lt;width&gt;</code>. Using <code>--stat</code> or
603<code>--stat-graph-width</code> affects all commands generating a stat graph,
604while setting <code>diff.statNameWidth</code> or <code>diff.statGraphWidth</code>
605does not affect <code>git format-patch</code>.
606By giving a third parameter <code>&lt;count&gt;</code>, you can limit the output to
607the first <code>&lt;count&gt;</code> lines, followed by <code>...</code> if there are more.</p>
608<div class="paragraph">
609<p>These parameters can also be set individually with <code>--stat-width=&lt;width&gt;</code>,
610<code>--stat-name-width=&lt;name-width&gt;</code> and <code>--stat-count=&lt;count&gt;</code>.</p>
611</div>
612</dd>
613<dt class="hdlist1">--compact-summary</dt>
614<dd>
615<p>Output a condensed summary of extended header information such
616as file creations or deletions ("new" or "gone", optionally "+l"
617if it&#8217;s a symlink) and mode changes ("+x" or "-x" for adding
618or removing executable bit respectively) in diffstat. The
619information is put between the filename part and the graph
620part. Implies <code>--stat</code>.</p>
621</dd>
622<dt class="hdlist1">--numstat</dt>
623<dd>
624<p>Similar to <code>--stat</code>, but shows number of added and
625deleted lines in decimal notation and pathname without
626abbreviation, to make it more machine friendly. For
627binary files, outputs two <code>-</code> instead of saying
628<code>0 0</code>.</p>
629</dd>
630<dt class="hdlist1">--shortstat</dt>
631<dd>
632<p>Output only the last line of the <code>--stat</code> format containing total
633number of modified files, as well as number of added and deleted
634lines.</p>
635</dd>
636<dt class="hdlist1">-X[&lt;param1,param2,&#8230;&#8203;&gt;]</dt>
637<dt class="hdlist1">--dirstat[=&lt;param1,param2,&#8230;&#8203;&gt;]</dt>
638<dd>
639<p>Output the distribution of relative amount of changes for each
640sub-directory. The behavior of <code>--dirstat</code> can be customized by
641passing it a comma separated list of parameters.
642The defaults are controlled by the <code>diff.dirstat</code> configuration
643variable (see <a href="git-config.html">git-config(1)</a>).
644The following parameters are available:</p>
645<div class="openblock">
646<div class="content">
647<div class="dlist">
648<dl>
649<dt class="hdlist1"><code>changes</code></dt>
650<dd>
651<p>Compute the dirstat numbers by counting the lines that have been
652removed from the source, or added to the destination. This ignores
653the amount of pure code movements within a file. In other words,
654rearranging lines in a file is not counted as much as other changes.
655This is the default behavior when no parameter is given.</p>
656</dd>
657<dt class="hdlist1"><code>lines</code></dt>
658<dd>
659<p>Compute the dirstat numbers by doing the regular line-based diff
660analysis, and summing the removed/added line counts. (For binary
661files, count 64-byte chunks instead, since binary files have no
662natural concept of lines). This is a more expensive <code>--dirstat</code>
663behavior than the <code>changes</code> behavior, but it does count rearranged
664lines within a file as much as other changes. The resulting output
665is consistent with what you get from the other <code>--*stat</code> options.</p>
666</dd>
667<dt class="hdlist1"><code>files</code></dt>
668<dd>
669<p>Compute the dirstat numbers by counting the number of files changed.
670Each changed file counts equally in the dirstat analysis. This is
671the computationally cheapest <code>--dirstat</code> behavior, since it does
672not have to look at the file contents at all.</p>
673</dd>
674<dt class="hdlist1"><code>cumulative</code></dt>
675<dd>
676<p>Count changes in a child directory for the parent directory as well.
677Note that when using <code>cumulative</code>, the sum of the percentages
678reported may exceed 100%. The default (non-cumulative) behavior can
679be specified with the <code>noncumulative</code> parameter.</p>
680</dd>
681<dt class="hdlist1">&lt;limit&gt;</dt>
682<dd>
683<p>An integer parameter specifies a cut-off percent (3% by default).
684Directories contributing less than this percentage of the changes
685are not shown in the output.</p>
686</dd>
687</dl>
688</div>
689</div>
690</div>
691<div class="paragraph">
692<p>Example: The following will count changed files, while ignoring
693directories with less than 10% of the total amount of changed files,
694and accumulating child directory counts in the parent directories:
695<code>--dirstat=files,10,cumulative</code>.</p>
696</div>
697</dd>
698<dt class="hdlist1">--cumulative</dt>
699<dd>
700<p>Synonym for --dirstat=cumulative</p>
701</dd>
702<dt class="hdlist1">--dirstat-by-file[=&lt;param1,param2&gt;&#8230;&#8203;]</dt>
703<dd>
704<p>Synonym for --dirstat=files,&lt;param1&gt;,&lt;param2&gt;&#8230;&#8203;</p>
705</dd>
706<dt class="hdlist1">--summary</dt>
707<dd>
708<p>Output a condensed summary of extended header information
709such as creations, renames and mode changes.</p>
710</dd>
711<dt class="hdlist1">--patch-with-stat</dt>
712<dd>
713<p>Synonym for <code>-p --stat</code>.</p>
714</dd>
715<dt class="hdlist1">-z</dt>
716<dd>
717<p>When <code>--raw</code>, <code>--numstat</code>, <code>--name-only</code> or <code>--name-status</code> has been
718given, do not munge pathnames and use NULs as output field terminators.</p>
719<div class="paragraph">
720<p>Without this option, pathnames with "unusual" characters are quoted as
721explained for the configuration variable <code>core.quotePath</code> (see
722<a href="git-config.html">git-config(1)</a>).</p>
723</div>
724</dd>
725<dt class="hdlist1">--name-only</dt>
726<dd>
727<p>Show only the name of each changed file in the post-image tree.
728The file names are often encoded in UTF-8.
729For more information see the discussion about encoding in the <a href="git-log.html">git-log(1)</a>
730manual page.</p>
731</dd>
732<dt class="hdlist1">--name-status</dt>
733<dd>
734<p>Show only the name(s) and status of each changed file. See the description
735of the <code>--diff-filter</code> option on what the status letters mean.
736Just like <code>--name-only</code> the file names are often encoded in UTF-8.</p>
737</dd>
738<dt class="hdlist1">--submodule[=&lt;format&gt;]</dt>
739<dd>
740<p>Specify how differences in submodules are shown. When specifying
741<code>--submodule=short</code> the <em>short</em> format is used. This format just
742shows the names of the commits at the beginning and end of the range.
743When <code>--submodule</code> or <code>--submodule=log</code> is specified, the <em>log</em>
744format is used. This format lists the commits in the range like
745<a href="git-submodule.html">git-submodule(1)</a> <code>summary</code> does. When <code>--submodule=diff</code>
746is specified, the <em>diff</em> format is used. This format shows an
747inline diff of the changes in the submodule contents between the
748commit range. Defaults to <code>diff.submodule</code> or the <em>short</em> format
749if the config option is unset.</p>
750</dd>
751<dt class="hdlist1">--color[=&lt;when&gt;]</dt>
752<dd>
753<p>Show colored diff.
754<code>--color</code> (i.e. without <em>=&lt;when&gt;</em>) is the same as <code>--color=always</code>.
755<em>&lt;when&gt;</em> can be one of <code>always</code>, <code>never</code>, or <code>auto</code>.</p>
756</dd>
757<dt class="hdlist1">--no-color</dt>
758<dd>
759<p>Turn off colored diff.
760It is the same as <code>--color=never</code>.</p>
761</dd>
762<dt class="hdlist1">--color-moved[=&lt;mode&gt;]</dt>
763<dd>
764<p>Moved lines of code are colored differently.
765The &lt;mode&gt; defaults to <em>no</em> if the option is not given
766and to <em>zebra</em> if the option with no mode is given.
767The mode must be one of:</p>
768<div class="openblock">
769<div class="content">
770<div class="dlist">
771<dl>
772<dt class="hdlist1">no</dt>
773<dd>
774<p>Moved lines are not highlighted.</p>
775</dd>
776<dt class="hdlist1">default</dt>
777<dd>
778<p>Is a synonym for <code>zebra</code>. This may change to a more sensible mode
779in the future.</p>
780</dd>
781<dt class="hdlist1">plain</dt>
782<dd>
783<p>Any line that is added in one location and was removed
784in another location will be colored with <em>color.diff.newMoved</em>.
785Similarly <em>color.diff.oldMoved</em> will be used for removed lines
786that are added somewhere else in the diff. This mode picks up any
787moved line, but it is not very useful in a review to determine
788if a block of code was moved without permutation.</p>
789</dd>
790<dt class="hdlist1">blocks</dt>
791<dd>
792<p>Blocks of moved text of at least 20 alphanumeric characters
793are detected greedily. The detected blocks are
794painted using either the <em>color.diff.{old,new}Moved</em> color.
795Adjacent blocks cannot be told apart.</p>
796</dd>
797<dt class="hdlist1">zebra</dt>
798<dd>
799<p>Blocks of moved text are detected as in <em>blocks</em> mode. The blocks
800are painted using either the <em>color.diff.{old,new}Moved</em> color or
801<em>color.diff.{old,new}MovedAlternative</em>. The change between
802the two colors indicates that a new block was detected.</p>
803</dd>
804<dt class="hdlist1">dimmed-zebra</dt>
805<dd>
806<p>Similar to <em>zebra</em>, but additional dimming of uninteresting parts
807of moved code is performed. The bordering lines of two adjacent
808blocks are considered interesting, the rest is uninteresting.
809<code>dimmed_zebra</code> is a deprecated synonym.</p>
810</dd>
811</dl>
812</div>
813</div>
814</div>
815</dd>
816<dt class="hdlist1">--no-color-moved</dt>
817<dd>
818<p>Turn off move detection. This can be used to override configuration
819settings. It is the same as <code>--color-moved=no</code>.</p>
820</dd>
821<dt class="hdlist1">--color-moved-ws=&lt;modes&gt;</dt>
822<dd>
823<p>This configures how whitespace is ignored when performing the
824move detection for <code>--color-moved</code>.
825These modes can be given as a comma separated list:</p>
826<div class="openblock">
827<div class="content">
828<div class="dlist">
829<dl>
830<dt class="hdlist1">no</dt>
831<dd>
832<p>Do not ignore whitespace when performing move detection.</p>
833</dd>
834<dt class="hdlist1">ignore-space-at-eol</dt>
835<dd>
836<p>Ignore changes in whitespace at EOL.</p>
837</dd>
838<dt class="hdlist1">ignore-space-change</dt>
839<dd>
840<p>Ignore changes in amount of whitespace. This ignores whitespace
841at line end, and considers all other sequences of one or
842more whitespace characters to be equivalent.</p>
843</dd>
844<dt class="hdlist1">ignore-all-space</dt>
845<dd>
846<p>Ignore whitespace when comparing lines. This ignores differences
847even if one line has whitespace where the other line has none.</p>
848</dd>
849<dt class="hdlist1">allow-indentation-change</dt>
850<dd>
851<p>Initially ignore any whitespace in the move detection, then
852group the moved code blocks only into a block if the change in
853whitespace is the same per line. This is incompatible with the
854other modes.</p>
855</dd>
856</dl>
857</div>
858</div>
859</div>
860</dd>
861<dt class="hdlist1">--no-color-moved-ws</dt>
862<dd>
863<p>Do not ignore whitespace when performing move detection. This can be
864used to override configuration settings. It is the same as
865<code>--color-moved-ws=no</code>.</p>
866</dd>
867<dt class="hdlist1">--word-diff[=&lt;mode&gt;]</dt>
868<dd>
869<p>Show a word diff, using the &lt;mode&gt; to delimit changed words.
870By default, words are delimited by whitespace; see
871<code>--word-diff-regex</code> below. The &lt;mode&gt; defaults to <em>plain</em>, and
872must be one of:</p>
873<div class="openblock">
874<div class="content">
875<div class="dlist">
876<dl>
877<dt class="hdlist1">color</dt>
878<dd>
879<p>Highlight changed words using only colors. Implies <code>--color</code>.</p>
880</dd>
881<dt class="hdlist1">plain</dt>
882<dd>
883<p>Show words as <code>[-removed-]</code> and <code>{+added+}</code>. Makes no
884attempts to escape the delimiters if they appear in the input,
885so the output may be ambiguous.</p>
886</dd>
887<dt class="hdlist1">porcelain</dt>
888<dd>
889<p>Use a special line-based format intended for script
890consumption. Added/removed/unchanged runs are printed in the
891usual unified diff format, starting with a <code>+</code>/<code>-</code>/` `
892character at the beginning of the line and extending to the
893end of the line. Newlines in the input are represented by a
894tilde <code>~</code> on a line of its own.</p>
895</dd>
896<dt class="hdlist1">none</dt>
897<dd>
898<p>Disable word diff again.</p>
899</dd>
900</dl>
901</div>
902</div>
903</div>
904<div class="paragraph">
905<p>Note that despite the name of the first mode, color is used to
906highlight the changed parts in all modes if enabled.</p>
907</div>
908</dd>
909<dt class="hdlist1">--word-diff-regex=&lt;regex&gt;</dt>
910<dd>
911<p>Use &lt;regex&gt; to decide what a word is, instead of considering
912runs of non-whitespace to be a word. Also implies
913<code>--word-diff</code> unless it was already enabled.</p>
914<div class="paragraph">
915<p>Every non-overlapping match of the
916&lt;regex&gt; is considered a word. Anything between these matches is
917considered whitespace and ignored(!) for the purposes of finding
918differences. You may want to append <code>|[^[:space:]]</code> to your regular
919expression to make sure that it matches all non-whitespace characters.
920A match that contains a newline is silently truncated(!) at the
921newline.</p>
922</div>
923<div class="paragraph">
924<p>For example, <code>--word-diff-regex=.</code> will treat each character as a word
925and, correspondingly, show differences character by character.</p>
926</div>
927<div class="paragraph">
928<p>The regex can also be set via a diff driver or configuration option, see
929<a href="gitattributes.html">gitattributes(5)</a> or <a href="git-config.html">git-config(1)</a>. Giving it explicitly
930overrides any diff driver or configuration setting. Diff drivers
931override configuration settings.</p>
932</div>
933</dd>
934<dt class="hdlist1">--color-words[=&lt;regex&gt;]</dt>
935<dd>
936<p>Equivalent to <code>--word-diff=color</code> plus (if a regex was
937specified) <code>--word-diff-regex=&lt;regex&gt;</code>.</p>
938</dd>
939<dt class="hdlist1">--no-renames</dt>
940<dd>
941<p>Turn off rename detection, even when the configuration
942file gives the default to do so.</p>
943</dd>
944<dt class="hdlist1">--[no-]rename-empty</dt>
945<dd>
946<p>Whether to use empty blobs as rename source.</p>
947</dd>
948<dt class="hdlist1">--check</dt>
949<dd>
950<p>Warn if changes introduce conflict markers or whitespace errors.
951What are considered whitespace errors is controlled by <code>core.whitespace</code>
952configuration. By default, trailing whitespaces (including
953lines that consist solely of whitespaces) and a space character
954that is immediately followed by a tab character inside the
955initial indent of the line are considered whitespace errors.
956Exits with non-zero status if problems are found. Not compatible
957with --exit-code.</p>
958</dd>
959<dt class="hdlist1">--ws-error-highlight=&lt;kind&gt;</dt>
960<dd>
961<p>Highlight whitespace errors in the <code>context</code>, <code>old</code> or <code>new</code>
962lines of the diff. Multiple values are separated by comma,
963<code>none</code> resets previous values, <code>default</code> reset the list to
964<code>new</code> and <code>all</code> is a shorthand for <code>old,new,context</code>. When
965this option is not given, and the configuration variable
966<code>diff.wsErrorHighlight</code> is not set, only whitespace errors in
967<code>new</code> lines are highlighted. The whitespace errors are colored
968with <code>color.diff.whitespace</code>.</p>
969</dd>
970<dt class="hdlist1">--full-index</dt>
971<dd>
972<p>Instead of the first handful of characters, show the full
973pre- and post-image blob object names on the "index"
974line when generating patch format output.</p>
975</dd>
976<dt class="hdlist1">--binary</dt>
977<dd>
978<p>In addition to <code>--full-index</code>, output a binary diff that
979can be applied with <code>git-apply</code>.
980Implies <code>--patch</code>.</p>
981</dd>
982<dt class="hdlist1">--abbrev[=&lt;n&gt;]</dt>
983<dd>
984<p>Instead of showing the full 40-byte hexadecimal object
985name in diff-raw format output and diff-tree header
986lines, show the shortest prefix that is at least <em>&lt;n&gt;</em>
987hexdigits long that uniquely refers the object.
988In diff-patch output format, <code>--full-index</code> takes higher
989precedence, i.e. if <code>--full-index</code> is specified, full blob
990names will be shown regardless of <code>--abbrev</code>.
991Non default number of digits can be specified with <code>--abbrev=&lt;n&gt;</code>.</p>
992</dd>
993<dt class="hdlist1">-B[&lt;n&gt;][/&lt;m&gt;]</dt>
994<dt class="hdlist1">--break-rewrites[=[&lt;n&gt;][/&lt;m&gt;]]</dt>
995<dd>
996<p>Break complete rewrite changes into pairs of delete and
997create. This serves two purposes:</p>
998<div class="paragraph">
999<p>It affects the way a change that amounts to a total rewrite of a file
1000not as a series of deletion and insertion mixed together with a very
1001few lines that happen to match textually as the context, but as a
1002single deletion of everything old followed by a single insertion of
1003everything new, and the number <code>m</code> controls this aspect of the -B
1004option (defaults to 60%). <code>-B/70%</code> specifies that less than 30% of the
1005original should remain in the result for Git to consider it a total
1006rewrite (i.e. otherwise the resulting patch will be a series of
1007deletion and insertion mixed together with context lines).</p>
1008</div>
1009<div class="paragraph">
1010<p>When used with -M, a totally-rewritten file is also considered as the
1011source of a rename (usually -M only considers a file that disappeared
1012as the source of a rename), and the number <code>n</code> controls this aspect of
1013the -B option (defaults to 50%). <code>-B20%</code> specifies that a change with
1014addition and deletion compared to 20% or more of the file&#8217;s size are
1015eligible for being picked up as a possible source of a rename to
1016another file.</p>
1017</div>
1018</dd>
1019<dt class="hdlist1">-M[&lt;n&gt;]</dt>
1020<dt class="hdlist1">--find-renames[=&lt;n&gt;]</dt>
1021<dd>
1022<p>Detect renames.
1023If <code>n</code> is specified, it is a threshold on the similarity
1024index (i.e. amount of addition/deletions compared to the
1025file&#8217;s size). For example, <code>-M90%</code> means Git should consider a
1026delete/add pair to be a rename if more than 90% of the file
1027hasn&#8217;t changed. Without a <code>%</code> sign, the number is to be read as
1028a fraction, with a decimal point before it. I.e., <code>-M5</code> becomes
10290.5, and is thus the same as <code>-M50%</code>. Similarly, <code>-M05</code> is
1030the same as <code>-M5%</code>. To limit detection to exact renames, use
1031<code>-M100%</code>. The default similarity index is 50%.</p>
1032</dd>
1033<dt class="hdlist1">-C[&lt;n&gt;]</dt>
1034<dt class="hdlist1">--find-copies[=&lt;n&gt;]</dt>
1035<dd>
1036<p>Detect copies as well as renames. See also <code>--find-copies-harder</code>.
1037If <code>n</code> is specified, it has the same meaning as for <code>-M&lt;n&gt;</code>.</p>
1038</dd>
1039<dt class="hdlist1">--find-copies-harder</dt>
1040<dd>
1041<p>For performance reasons, by default, <code>-C</code> option finds copies only
1042if the original file of the copy was modified in the same
1043changeset. This flag makes the command
1044inspect unmodified files as candidates for the source of
1045copy. This is a very expensive operation for large
1046projects, so use it with caution. Giving more than one
1047<code>-C</code> option has the same effect.</p>
1048</dd>
1049<dt class="hdlist1">-D</dt>
1050<dt class="hdlist1">--irreversible-delete</dt>
1051<dd>
1052<p>Omit the preimage for deletes, i.e. print only the header but not
1053the diff between the preimage and <code>/dev/null</code>. The resulting patch
1054is not meant to be applied with <code>patch</code> or <code>git apply</code>; this is
1055solely for people who want to just concentrate on reviewing the
1056text after the change. In addition, the output obviously lacks
1057enough information to apply such a patch in reverse, even manually,
1058hence the name of the option.</p>
1059<div class="paragraph">
1060<p>When used together with <code>-B</code>, omit also the preimage in the deletion part
1061of a delete/create pair.</p>
1062</div>
1063</dd>
1064<dt class="hdlist1">-l&lt;num&gt;</dt>
1065<dd>
1066<p>The <code>-M</code> and <code>-C</code> options involve some preliminary steps that
1067can detect subsets of renames/copies cheaply, followed by an
1068exhaustive fallback portion that compares all remaining
1069unpaired destinations to all relevant sources. (For renames,
1070only remaining unpaired sources are relevant; for copies, all
1071original sources are relevant.) For N sources and
1072destinations, this exhaustive check is O(N^2). This option
1073prevents the exhaustive portion of rename/copy detection from
1074running if the number of source/destination files involved
1075exceeds the specified number. Defaults to diff.renameLimit.
1076Note that a value of 0 is treated as unlimited.</p>
1077</dd>
1078<dt class="hdlist1">--diff-filter=[(A|C|D|M|R|T|U|X|B)&#8230;&#8203;[*]]</dt>
1079<dd>
1080<p>Select only files that are Added (<code>A</code>), Copied (<code>C</code>),
1081Deleted (<code>D</code>), Modified (<code>M</code>), Renamed (<code>R</code>), have their
1082type (i.e. regular file, symlink, submodule, &#8230;&#8203;) changed (<code>T</code>),
1083are Unmerged (<code>U</code>), are
1084Unknown (<code>X</code>), or have had their pairing Broken (<code>B</code>).
1085Any combination of the filter characters (including none) can be used.
1086When <code>*</code> (All-or-none) is added to the combination, all
1087paths are selected if there is any file that matches
1088other criteria in the comparison; if there is no file
1089that matches other criteria, nothing is selected.</p>
1090<div class="paragraph">
1091<p>Also, these upper-case letters can be downcased to exclude. E.g.
1092<code>--diff-filter=ad</code> excludes added and deleted paths.</p>
1093</div>
1094<div class="paragraph">
1095<p>Note that not all diffs can feature all types. For instance, copied and
1096renamed entries cannot appear if detection for those types is disabled.</p>
1097</div>
1098</dd>
1099<dt class="hdlist1">-S&lt;string&gt;</dt>
1100<dd>
1101<p>Look for differences that change the number of occurrences of
1102the specified string (i.e. addition/deletion) in a file.
1103Intended for the scripter&#8217;s use.</p>
1104<div class="paragraph">
1105<p>It is useful when you&#8217;re looking for an exact block of code (like a
1106struct), and want to know the history of that block since it first
1107came into being: use the feature iteratively to feed the interesting
1108block in the preimage back into <code>-S</code>, and keep going until you get the
1109very first version of the block.</p>
1110</div>
1111<div class="paragraph">
1112<p>Binary files are searched as well.</p>
1113</div>
1114</dd>
1115<dt class="hdlist1">-G&lt;regex&gt;</dt>
1116<dd>
1117<p>Look for differences whose patch text contains added/removed
1118lines that match &lt;regex&gt;.</p>
1119<div class="paragraph">
1120<p>To illustrate the difference between <code>-S&lt;regex&gt; --pickaxe-regex</code> and
1121<code>-G&lt;regex&gt;</code>, consider a commit with the following diff in the same
1122file:</p>
1123</div>
1124<div class="listingblock">
1125<div class="content">
1126<pre>+ return frotz(nitfol, two-&gt;ptr, 1, 0);
1127...
1128- hit = frotz(nitfol, mf2.ptr, 1, 0);</pre>
1129</div>
1130</div>
1131<div class="paragraph">
1132<p>While <code>git log -G"frotz\(nitfol"</code> will show this commit, <code>git log
1133-S"frotz\(nitfol" --pickaxe-regex</code> will not (because the number of
1134occurrences of that string did not change).</p>
1135</div>
1136<div class="paragraph">
1137<p>Unless <code>--text</code> is supplied patches of binary files without a textconv
1138filter will be ignored.</p>
1139</div>
1140<div class="paragraph">
1141<p>See the <em>pickaxe</em> entry in <a href="gitdiffcore.html">gitdiffcore(7)</a> for more
1142information.</p>
1143</div>
1144</dd>
1145<dt class="hdlist1">--find-object=&lt;object-id&gt;</dt>
1146<dd>
1147<p>Look for differences that change the number of occurrences of
1148the specified object. Similar to <code>-S</code>, just the argument is different
1149in that it doesn&#8217;t search for a specific string but for a specific
1150object id.</p>
1151<div class="paragraph">
1152<p>The object can be a blob or a submodule commit. It implies the <code>-t</code> option in
1153<code>git-log</code> to also find trees.</p>
1154</div>
1155</dd>
1156<dt class="hdlist1">--pickaxe-all</dt>
1157<dd>
1158<p>When <code>-S</code> or <code>-G</code> finds a change, show all the changes in that
1159changeset, not just the files that contain the change
1160in &lt;string&gt;.</p>
1161</dd>
1162<dt class="hdlist1">--pickaxe-regex</dt>
1163<dd>
1164<p>Treat the &lt;string&gt; given to <code>-S</code> as an extended POSIX regular
1165expression to match.</p>
1166</dd>
1167<dt class="hdlist1">-O&lt;orderfile&gt;</dt>
1168<dd>
1169<p>Control the order in which files appear in the output.
1170This overrides the <code>diff.orderFile</code> configuration variable
1171(see <a href="git-config.html">git-config(1)</a>). To cancel <code>diff.orderFile</code>,
1172use <code>-O/dev/null</code>.</p>
1173<div class="paragraph">
1174<p>The output order is determined by the order of glob patterns in
1175&lt;orderfile&gt;.
1176All files with pathnames that match the first pattern are output
1177first, all files with pathnames that match the second pattern (but not
1178the first) are output next, and so on.
1179All files with pathnames that do not match any pattern are output
1180last, as if there was an implicit match-all pattern at the end of the
1181file.
1182If multiple pathnames have the same rank (they match the same pattern
1183but no earlier patterns), their output order relative to each other is
1184the normal order.</p>
1185</div>
1186<div class="paragraph">
1187<p>&lt;orderfile&gt; is parsed as follows:</p>
1188</div>
1189<div class="openblock">
1190<div class="content">
1191<div class="ulist">
1192<ul>
1193<li>
1194<p>Blank lines are ignored, so they can be used as separators for
1195readability.</p>
1196</li>
1197<li>
1198<p>Lines starting with a hash ("<code>#</code>") are ignored, so they can be used
1199for comments. Add a backslash ("<code>\</code>") to the beginning of the
1200pattern if it starts with a hash.</p>
1201</li>
1202<li>
1203<p>Each other line contains a single pattern.</p>
1204</li>
1205</ul>
1206</div>
1207</div>
1208</div>
1209<div class="paragraph">
1210<p>Patterns have the same syntax and semantics as patterns used for
1211fnmatch(3) without the FNM_PATHNAME flag, except a pathname also
1212matches a pattern if removing any number of the final pathname
1213components matches the pattern. For example, the pattern "<code>foo*bar</code>"
1214matches "<code>fooasdfbar</code>" and "<code>foo/bar/baz/asdf</code>" but not "<code>foobarx</code>".</p>
1215</div>
1216</dd>
1217<dt class="hdlist1">--skip-to=&lt;file&gt;</dt>
1218<dt class="hdlist1">--rotate-to=&lt;file&gt;</dt>
1219<dd>
1220<p>Discard the files before the named &lt;file&gt; from the output
1221(i.e. <em>skip to</em>), or move them to the end of the output
1222(i.e. <em>rotate to</em>). These options were invented primarily for the use
1223of the <code>git difftool</code> command, and may not be very useful
1224otherwise.</p>
1225</dd>
1226<dt class="hdlist1">-R</dt>
1227<dd>
1228<p>Swap two inputs; that is, show differences from index or
1229on-disk file to tree contents.</p>
1230</dd>
1231<dt class="hdlist1">--relative[=&lt;path&gt;]</dt>
1232<dt class="hdlist1">--no-relative</dt>
1233<dd>
1234<p>When run from a subdirectory of the project, it can be
1235told to exclude changes outside the directory and show
1236pathnames relative to it with this option. When you are
1237not in a subdirectory (e.g. in a bare repository), you
1238can name which subdirectory to make the output relative
1239to by giving a &lt;path&gt; as an argument.
1240<code>--no-relative</code> can be used to countermand both <code>diff.relative</code> config
1241option and previous <code>--relative</code>.</p>
1242</dd>
1243<dt class="hdlist1">-a</dt>
1244<dt class="hdlist1">--text</dt>
1245<dd>
1246<p>Treat all files as text.</p>
1247</dd>
1248<dt class="hdlist1">--ignore-cr-at-eol</dt>
1249<dd>
1250<p>Ignore carriage-return at the end of line when doing a comparison.</p>
1251</dd>
1252<dt class="hdlist1">--ignore-space-at-eol</dt>
1253<dd>
1254<p>Ignore changes in whitespace at EOL.</p>
1255</dd>
1256<dt class="hdlist1">-b</dt>
1257<dt class="hdlist1">--ignore-space-change</dt>
1258<dd>
1259<p>Ignore changes in amount of whitespace. This ignores whitespace
1260at line end, and considers all other sequences of one or
1261more whitespace characters to be equivalent.</p>
1262</dd>
1263<dt class="hdlist1">-w</dt>
1264<dt class="hdlist1">--ignore-all-space</dt>
1265<dd>
1266<p>Ignore whitespace when comparing lines. This ignores
1267differences even if one line has whitespace where the other
1268line has none.</p>
1269</dd>
1270<dt class="hdlist1">--ignore-blank-lines</dt>
1271<dd>
1272<p>Ignore changes whose lines are all blank.</p>
1273</dd>
1274<dt class="hdlist1">-I&lt;regex&gt;</dt>
1275<dt class="hdlist1">--ignore-matching-lines=&lt;regex&gt;</dt>
1276<dd>
1277<p>Ignore changes whose all lines match &lt;regex&gt;. This option may
1278be specified more than once.</p>
1279</dd>
1280<dt class="hdlist1">--inter-hunk-context=&lt;lines&gt;</dt>
1281<dd>
1282<p>Show the context between diff hunks, up to the specified number
1283of lines, thereby fusing hunks that are close to each other.
1284Defaults to <code>diff.interHunkContext</code> or 0 if the config option
1285is unset.</p>
1286</dd>
1287<dt class="hdlist1">-W</dt>
1288<dt class="hdlist1">--function-context</dt>
1289<dd>
1290<p>Show whole function as context lines for each change.
1291The function names are determined in the same way as
1292<code>git diff</code> works out patch hunk headers (see <em>Defining a
1293custom hunk-header</em> in <a href="gitattributes.html">gitattributes(5)</a>).</p>
1294</dd>
1295<dt class="hdlist1">--exit-code</dt>
1296<dd>
1297<p>Make the program exit with codes similar to diff(1).
1298That is, it exits with 1 if there were differences and
12990 means no differences.</p>
1300</dd>
1301<dt class="hdlist1">--quiet</dt>
1302<dd>
1303<p>Disable all output of the program. Implies <code>--exit-code</code>.
1304Disables execution of external diff helpers whose exit code
1305is not trusted, i.e. their respective configuration option
1306<code>diff.trustExitCode</code> or <code>diff.&lt;driver&gt;.trustExitCode</code> or
1307environment variable <code>GIT_EXTERNAL_DIFF_TRUST_EXIT_CODE</code> is
1308false.</p>
1309</dd>
1310<dt class="hdlist1">--ext-diff</dt>
1311<dd>
1312<p>Allow an external diff helper to be executed. If you set an
1313external diff driver with <a href="gitattributes.html">gitattributes(5)</a>, you need
1314to use this option with <a href="git-log.html">git-log(1)</a> and friends.</p>
1315</dd>
1316<dt class="hdlist1">--no-ext-diff</dt>
1317<dd>
1318<p>Disallow external diff drivers.</p>
1319</dd>
1320<dt class="hdlist1">--textconv</dt>
1321<dt class="hdlist1">--no-textconv</dt>
1322<dd>
1323<p>Allow (or disallow) external text conversion filters to be run
1324when comparing binary files. See <a href="gitattributes.html">gitattributes(5)</a> for
1325details. Because textconv filters are typically a one-way
1326conversion, the resulting diff is suitable for human
1327consumption, but cannot be applied. For this reason, textconv
1328filters are enabled by default only for <a href="git-diff.html">git-diff(1)</a> and
1329<a href="git-log.html">git-log(1)</a>, but not for <a href="git-format-patch.html">git-format-patch(1)</a> or
1330diff plumbing commands.</p>
1331</dd>
1332<dt class="hdlist1">--ignore-submodules[=&lt;when&gt;]</dt>
1333<dd>
1334<p>Ignore changes to submodules in the diff generation. &lt;when&gt; can be
1335either "none", "untracked", "dirty" or "all", which is the default.
1336Using "none" will consider the submodule modified when it either contains
1337untracked or modified files or its HEAD differs from the commit recorded
1338in the superproject and can be used to override any settings of the
1339<em>ignore</em> option in <a href="git-config.html">git-config(1)</a> or <a href="gitmodules.html">gitmodules(5)</a>. When
1340"untracked" is used submodules are not considered dirty when they only
1341contain untracked content (but they are still scanned for modified
1342content). Using "dirty" ignores all changes to the work tree of submodules,
1343only changes to the commits stored in the superproject are shown (this was
1344the behavior until 1.7.0). Using "all" hides all changes to submodules.</p>
1345</dd>
1346<dt class="hdlist1">--src-prefix=&lt;prefix&gt;</dt>
1347<dd>
1348<p>Show the given source prefix instead of "a/".</p>
1349</dd>
1350<dt class="hdlist1">--dst-prefix=&lt;prefix&gt;</dt>
1351<dd>
1352<p>Show the given destination prefix instead of "b/".</p>
1353</dd>
1354<dt class="hdlist1">--no-prefix</dt>
1355<dd>
1356<p>Do not show any source or destination prefix.</p>
1357</dd>
1358<dt class="hdlist1">--default-prefix</dt>
1359<dd>
1360<p>Use the default source and destination prefixes ("a/" and "b/").
1361This overrides configuration variables such as <code>diff.noprefix</code>,
1362<code>diff.srcPrefix</code>, <code>diff.dstPrefix</code>, and <code>diff.mnemonicPrefix</code>
1363(see <code>git-config</code>(1)).</p>
1364</dd>
1365<dt class="hdlist1">--line-prefix=&lt;prefix&gt;</dt>
1366<dd>
1367<p>Prepend an additional prefix to every line of output.</p>
1368</dd>
1369<dt class="hdlist1">--ita-invisible-in-index</dt>
1370<dd>
1371<p>By default entries added by "git add -N" appear as an existing
1372empty file in "git diff" and a new file in "git diff --cached".
1373This option makes the entry appear as a new file in "git diff"
1374and non-existent in "git diff --cached". This option could be
1375reverted with <code>--ita-visible-in-index</code>. Both options are
1376experimental and could be removed in future.</p>
1377</dd>
1378</dl>
1379</div>
1380<div class="paragraph">
1381<p>For more detailed explanation on these common options, see also
1382<a href="gitdiffcore.html">gitdiffcore(7)</a>.</p>
1383</div>
1384<div class="dlist">
1385<dl>
1386<dt class="hdlist1">&lt;tree-ish&gt;</dt>
1387<dd>
1388<p>The id of a tree object.</p>
1389</dd>
1390<dt class="hdlist1">&lt;path&gt;&#8230;&#8203;</dt>
1391<dd>
1392<p>If provided, the results are limited to a subset of files
1393matching one of the provided pathspecs.</p>
1394</dd>
1395<dt class="hdlist1">-r</dt>
1396<dd>
1397<p>Recurse into sub-trees.</p>
1398</dd>
1399<dt class="hdlist1">-t</dt>
1400<dd>
1401<p>Show tree entry itself as well as subtrees. Implies -r.</p>
1402</dd>
1403<dt class="hdlist1">--root</dt>
1404<dd>
1405<p>When <code>--root</code> is specified the initial commit will be shown as a big
1406creation event. This is equivalent to a diff against the NULL tree.</p>
1407</dd>
1408<dt class="hdlist1">--merge-base</dt>
1409<dd>
1410<p>Instead of comparing the &lt;tree-ish&gt;s directly, use the merge
1411base between the two &lt;tree-ish&gt;s as the "before" side. There
1412must be two &lt;tree-ish&gt;s given and they must both be commits.</p>
1413</dd>
1414<dt class="hdlist1">--stdin</dt>
1415<dd>
1416<p>When <code>--stdin</code> is specified, the command does not take
1417&lt;tree-ish&gt; arguments from the command line. Instead, it
1418reads lines containing either two &lt;tree&gt;, one &lt;commit&gt;, or a
1419list of &lt;commit&gt; from its standard input. (Use a single space
1420as separator.)</p>
1421<div class="paragraph">
1422<p>When two trees are given, it compares the first tree with the second.
1423When a single commit is given, it compares the commit with its
1424parents. The remaining commits, when given, are used as if they are
1425parents of the first commit.</p>
1426</div>
1427<div class="paragraph">
1428<p>When comparing two trees, the ID of both trees (separated by a space
1429and terminated by a newline) is printed before the difference. When
1430comparing commits, the ID of the first (or only) commit, followed by a
1431newline, is printed.</p>
1432</div>
1433<div class="paragraph">
1434<p>The following flags further affect the behavior when comparing
1435commits (but not trees).</p>
1436</div>
1437</dd>
1438<dt class="hdlist1">-m</dt>
1439<dd>
1440<p>By default, <em>git diff-tree --stdin</em> does not show
1441differences for merge commits. With this flag, it shows
1442differences to that commit from all of its parents. See
1443also <code>-c</code>.</p>
1444</dd>
1445<dt class="hdlist1">-s</dt>
1446<dd>
1447<p>By default, <em>git diff-tree --stdin</em> shows differences,
1448either in machine-readable form (without <code>-p</code>) or in patch
1449form (with <code>-p</code>). This output can be suppressed. It is
1450only useful with the <code>-v</code> flag.</p>
1451</dd>
1452<dt class="hdlist1">-v</dt>
1453<dd>
1454<p>This flag causes <em>git diff-tree --stdin</em> to also show
1455the commit message before the differences.</p>
1456</dd>
1457<dt class="hdlist1">--pretty[=&lt;format&gt;]</dt>
1458<dt class="hdlist1">--format=&lt;format&gt;</dt>
1459<dd>
1460<p>Pretty-print the contents of the commit logs in a given format,
1461where <em>&lt;format&gt;</em> can be one of <em>oneline</em>, <em>short</em>, <em>medium</em>,
1462<em>full</em>, <em>fuller</em>, <em>reference</em>, <em>email</em>, <em>raw</em>, <em>format:&lt;string&gt;</em>
1463and <em>tformat:&lt;string&gt;</em>. When <em>&lt;format&gt;</em> is none of the above,
1464and has <em>%placeholder</em> in it, it acts as if
1465<em>--pretty=tformat:&lt;format&gt;</em> were given.</p>
1466<div class="paragraph">
1467<p>See the "PRETTY FORMATS" section for some additional details for each
1468format. When <em>=&lt;format&gt;</em> part is omitted, it defaults to <em>medium</em>.</p>
1469</div>
1470<div class="paragraph">
1471<p>Note: you can specify the default pretty format in the repository
1472configuration (see <a href="git-config.html">git-config(1)</a>).</p>
1473</div>
1474</dd>
1475<dt class="hdlist1">--abbrev-commit</dt>
1476<dd>
1477<p>Instead of showing the full 40-byte hexadecimal commit object
1478name, show a prefix that names the object uniquely.
1479"--abbrev=&lt;n&gt;" (which also modifies diff output, if it is displayed)
1480option can be used to specify the minimum length of the prefix.</p>
1481<div class="paragraph">
1482<p>This should make "--pretty=oneline" a whole lot more readable for
1483people using 80-column terminals.</p>
1484</div>
1485</dd>
1486<dt class="hdlist1">--no-abbrev-commit</dt>
1487<dd>
1488<p>Show the full 40-byte hexadecimal commit object name. This negates
1489<code>--abbrev-commit</code>, either explicit or implied by other options such
1490as "--oneline". It also overrides the <code>log.abbrevCommit</code> variable.</p>
1491</dd>
1492<dt class="hdlist1">--oneline</dt>
1493<dd>
1494<p>This is a shorthand for "--pretty=oneline --abbrev-commit"
1495used together.</p>
1496</dd>
1497<dt class="hdlist1">--encoding=&lt;encoding&gt;</dt>
1498<dd>
1499<p>Commit objects record the character encoding used for the log message
1500in their encoding header; this option can be used to tell the
1501command to re-code the commit log message in the encoding
1502preferred by the user. For non plumbing commands this
1503defaults to UTF-8. Note that if an object claims to be encoded
1504in <code>X</code> and we are outputting in <code>X</code>, we will output the object
1505verbatim; this means that invalid sequences in the original
1506commit may be copied to the output. Likewise, if iconv(3) fails
1507to convert the commit, we will quietly output the original
1508object verbatim.</p>
1509</dd>
1510<dt class="hdlist1">--expand-tabs=&lt;n&gt;</dt>
1511<dt class="hdlist1">--expand-tabs</dt>
1512<dt class="hdlist1">--no-expand-tabs</dt>
1513<dd>
1514<p>Perform a tab expansion (replace each tab with enough spaces
1515to fill to the next display column that is a multiple of <em>&lt;n&gt;</em>)
1516in the log message before showing it in the output.
1517<code>--expand-tabs</code> is a short-hand for <code>--expand-tabs=8</code>, and
1518<code>--no-expand-tabs</code> is a short-hand for <code>--expand-tabs=0</code>,
1519which disables tab expansion.</p>
1520<div class="paragraph">
1521<p>By default, tabs are expanded in pretty formats that indent the log
1522message by 4 spaces (i.e. <em>medium</em>, which is the default, <em>full</em>,
1523and <em>fuller</em>).</p>
1524</div>
1525</dd>
1526<dt class="hdlist1">--notes[=&lt;ref&gt;]</dt>
1527<dd>
1528<p>Show the notes (see <a href="git-notes.html">git-notes(1)</a>) that annotate the
1529commit, when showing the commit log message. This is the default
1530for <code>git log</code>, <code>git show</code> and <code>git whatchanged</code> commands when
1531there is no <code>--pretty</code>, <code>--format</code>, or <code>--oneline</code> option given
1532on the command line.</p>
1533<div class="paragraph">
1534<p>By default, the notes shown are from the notes refs listed in the
1535<code>core.notesRef</code> and <code>notes.displayRef</code> variables (or corresponding
1536environment overrides). See <a href="git-config.html">git-config(1)</a> for more details.</p>
1537</div>
1538<div class="paragraph">
1539<p>With an optional <em>&lt;ref&gt;</em> argument, use the ref to find the notes
1540to display. The ref can specify the full refname when it begins
1541with <code>refs/notes/</code>; when it begins with <code>notes/</code>, <code>refs/</code> and otherwise
1542<code>refs/notes/</code> is prefixed to form the full name of the ref.</p>
1543</div>
1544<div class="paragraph">
1545<p>Multiple --notes options can be combined to control which notes are
1546being displayed. Examples: "--notes=foo" will show only notes from
1547"refs/notes/foo"; "--notes=foo --notes" will show both notes from
1548"refs/notes/foo" and from the default notes ref(s).</p>
1549</div>
1550</dd>
1551<dt class="hdlist1">--no-notes</dt>
1552<dd>
1553<p>Do not show notes. This negates the above <code>--notes</code> option, by
1554resetting the list of notes refs from which notes are shown.
1555Options are parsed in the order given on the command line, so e.g.
1556"--notes --notes=foo --no-notes --notes=bar" will only show notes
1557from "refs/notes/bar".</p>
1558</dd>
1559<dt class="hdlist1">--show-notes-by-default</dt>
1560<dd>
1561<p>Show the default notes unless options for displaying specific
1562notes are given.</p>
1563</dd>
1564<dt class="hdlist1">--show-notes[=&lt;ref&gt;]</dt>
1565<dt class="hdlist1">--[no-]standard-notes</dt>
1566<dd>
1567<p>These options are deprecated. Use the above --notes/--no-notes
1568options instead.</p>
1569</dd>
1570<dt class="hdlist1">--show-signature</dt>
1571<dd>
1572<p>Check the validity of a signed commit object by passing the signature
1573to <code>gpg --verify</code> and show the output.</p>
1574</dd>
1575<dt class="hdlist1">--no-commit-id</dt>
1576<dd>
1577<p><em>git diff-tree</em> outputs a line with the commit ID when
Junio C Hamano902ce172024-08-21 21:02:371578applicable. This flag suppresses the commit ID output.</p>
Junio C Hamanob96f40a2024-08-01 00:57:251579</dd>
1580<dt class="hdlist1">-c</dt>
1581<dd>
1582<p>This flag changes the way a merge commit is displayed
1583(which means it is useful only when the command is given
1584one &lt;tree-ish&gt;, or <code>--stdin</code>). It shows the differences
1585from each of the parents to the merge result simultaneously
1586instead of showing pairwise diff between a parent and the
1587result one at a time (which is what the <code>-m</code> option does).
1588Furthermore, it lists only files which were modified
1589from all parents.</p>
1590</dd>
1591<dt class="hdlist1">--cc</dt>
1592<dd>
1593<p>This flag changes the way a merge commit patch is displayed,
1594in a similar way to the <code>-c</code> option. It implies the <code>-c</code>
1595and <code>-p</code> options and further compresses the patch output
1596by omitting uninteresting hunks whose contents in the parents
1597have only two variants and the merge result picks one of them
1598without modification. When all hunks are uninteresting, the commit
1599itself and the commit log message are not shown, just like in any other
1600"empty diff" case.</p>
1601</dd>
1602<dt class="hdlist1">--combined-all-paths</dt>
1603<dd>
1604<p>This flag causes combined diffs (used for merge commits) to
1605list the name of the file from all parents. It thus only has
1606effect when -c or --cc are specified, and is likely only
1607useful if filename changes are detected (i.e. when either
1608rename or copy detection have been requested).</p>
1609</dd>
1610<dt class="hdlist1">--always</dt>
1611<dd>
1612<p>Show the commit itself and the commit log message even
1613if the diff itself is empty.</p>
1614</dd>
1615</dl>
1616</div>
1617</div>
1618</div>
1619<div class="sect1">
1620<h2 id="_pretty_formats">PRETTY FORMATS</h2>
1621<div class="sectionbody">
1622<div class="paragraph">
1623<p>If the commit is a merge, and if the pretty-format
1624is not <em>oneline</em>, <em>email</em> or <em>raw</em>, an additional line is
1625inserted before the <em>Author:</em> line. This line begins with
1626"Merge: " and the hashes of ancestral commits are printed,
1627separated by spaces. Note that the listed commits may not
1628necessarily be the list of the <strong>direct</strong> parent commits if you
1629have limited your view of history: for example, if you are
1630only interested in changes related to a certain directory or
1631file.</p>
1632</div>
1633<div class="paragraph">
1634<p>There are several built-in formats, and you can define
1635additional formats by setting a pretty.&lt;name&gt;
1636config option to either another format name, or a
1637<em>format:</em> string, as described below (see
1638<a href="git-config.html">git-config(1)</a>). Here are the details of the
1639built-in formats:</p>
1640</div>
1641<div class="ulist">
1642<ul>
1643<li>
1644<p><em>oneline</em></p>
1645<div class="literalblock">
1646<div class="content">
1647<pre>&lt;hash&gt; &lt;title-line&gt;</pre>
1648</div>
1649</div>
1650<div class="paragraph">
1651<p>This is designed to be as compact as possible.</p>
1652</div>
1653</li>
1654<li>
1655<p><em>short</em></p>
1656<div class="literalblock">
1657<div class="content">
1658<pre>commit &lt;hash&gt;
1659Author: &lt;author&gt;</pre>
1660</div>
1661</div>
1662<div class="literalblock">
1663<div class="content">
1664<pre>&lt;title-line&gt;</pre>
1665</div>
1666</div>
1667</li>
1668<li>
1669<p><em>medium</em></p>
1670<div class="literalblock">
1671<div class="content">
1672<pre>commit &lt;hash&gt;
1673Author: &lt;author&gt;
1674Date: &lt;author-date&gt;</pre>
1675</div>
1676</div>
1677<div class="literalblock">
1678<div class="content">
1679<pre>&lt;title-line&gt;</pre>
1680</div>
1681</div>
1682<div class="literalblock">
1683<div class="content">
1684<pre>&lt;full-commit-message&gt;</pre>
1685</div>
1686</div>
1687</li>
1688<li>
1689<p><em>full</em></p>
1690<div class="literalblock">
1691<div class="content">
1692<pre>commit &lt;hash&gt;
1693Author: &lt;author&gt;
1694Commit: &lt;committer&gt;</pre>
1695</div>
1696</div>
1697<div class="literalblock">
1698<div class="content">
1699<pre>&lt;title-line&gt;</pre>
1700</div>
1701</div>
1702<div class="literalblock">
1703<div class="content">
1704<pre>&lt;full-commit-message&gt;</pre>
1705</div>
1706</div>
1707</li>
1708<li>
1709<p><em>fuller</em></p>
1710<div class="literalblock">
1711<div class="content">
1712<pre>commit &lt;hash&gt;
1713Author: &lt;author&gt;
1714AuthorDate: &lt;author-date&gt;
1715Commit: &lt;committer&gt;
1716CommitDate: &lt;committer-date&gt;</pre>
1717</div>
1718</div>
1719<div class="literalblock">
1720<div class="content">
1721<pre>&lt;title-line&gt;</pre>
1722</div>
1723</div>
1724<div class="literalblock">
1725<div class="content">
1726<pre>&lt;full-commit-message&gt;</pre>
1727</div>
1728</div>
1729</li>
1730<li>
1731<p><em>reference</em></p>
1732<div class="literalblock">
1733<div class="content">
1734<pre>&lt;abbrev-hash&gt; (&lt;title-line&gt;, &lt;short-author-date&gt;)</pre>
1735</div>
1736</div>
1737<div class="paragraph">
1738<p>This format is used to refer to another commit in a commit message and
1739is the same as <code>--pretty='format:%C(auto)%h (%s, %ad)'</code>. By default,
1740the date is formatted with <code>--date=short</code> unless another <code>--date</code> option
1741is explicitly specified. As with any <code>format:</code> with format
1742placeholders, its output is not affected by other options like
1743<code>--decorate</code> and <code>--walk-reflogs</code>.</p>
1744</div>
1745</li>
1746<li>
1747<p><em>email</em></p>
1748<div class="literalblock">
1749<div class="content">
1750<pre>From &lt;hash&gt; &lt;date&gt;
1751From: &lt;author&gt;
1752Date: &lt;author-date&gt;
1753Subject: [PATCH] &lt;title-line&gt;</pre>
1754</div>
1755</div>
1756<div class="literalblock">
1757<div class="content">
1758<pre>&lt;full-commit-message&gt;</pre>
1759</div>
1760</div>
1761</li>
1762<li>
1763<p><em>mboxrd</em></p>
1764<div class="paragraph">
1765<p>Like <em>email</em>, but lines in the commit message starting with "From "
1766(preceded by zero or more "&gt;") are quoted with "&gt;" so they aren&#8217;t
1767confused as starting a new commit.</p>
1768</div>
1769</li>
1770<li>
1771<p><em>raw</em></p>
1772<div class="paragraph">
1773<p>The <em>raw</em> format shows the entire commit exactly as
1774stored in the commit object. Notably, the hashes are
1775displayed in full, regardless of whether --abbrev or
1776--no-abbrev are used, and <em>parents</em> information show the
1777true parent commits, without taking grafts or history
1778simplification into account. Note that this format affects the way
1779commits are displayed, but not the way the diff is shown e.g. with
1780<code>git log --raw</code>. To get full object names in a raw diff format,
1781use <code>--no-abbrev</code>.</p>
1782</div>
1783</li>
1784<li>
1785<p><em>format:&lt;format-string&gt;</em></p>
1786<div class="paragraph">
1787<p>The <em>format:&lt;format-string&gt;</em> format allows you to specify which information
1788you want to show. It works a little bit like printf format,
1789with the notable exception that you get a newline with <em>%n</em>
1790instead of <em>\n</em>.</p>
1791</div>
1792<div class="paragraph">
1793<p>E.g, <em>format:"The author of %h was %an, %ar%nThe title was &gt;&gt;%s&lt;&lt;%n"</em>
1794would show something like this:</p>
1795</div>
1796<div class="listingblock">
1797<div class="content">
1798<pre>The author of fe6e0ee was Junio C Hamano, 23 hours ago
1799The title was &gt;&gt;t4119: test autocomputing -p&lt;n&gt; for traditional diff input.&lt;&lt;</pre>
1800</div>
1801</div>
1802<div class="paragraph">
1803<p>The placeholders are:</p>
1804</div>
1805<div class="ulist">
1806<ul>
1807<li>
1808<p>Placeholders that expand to a single literal character:</p>
1809<div class="dlist">
1810<dl>
1811<dt class="hdlist1"><em>%n</em></dt>
1812<dd>
1813<p>newline</p>
1814</dd>
1815<dt class="hdlist1"><em>%%</em></dt>
1816<dd>
1817<p>a raw <em>%</em></p>
1818</dd>
1819<dt class="hdlist1"><em>%x00</em></dt>
1820<dd>
1821<p><em>%x</em> followed by two hexadecimal digits is replaced with a
1822byte with the hexadecimal digits' value (we will call this
1823"literal formatting code" in the rest of this document).</p>
1824</dd>
1825</dl>
1826</div>
1827</li>
1828<li>
1829<p>Placeholders that affect formatting of later placeholders:</p>
1830<div class="dlist">
1831<dl>
1832<dt class="hdlist1"><em>%Cred</em></dt>
1833<dd>
1834<p>switch color to red</p>
1835</dd>
1836<dt class="hdlist1"><em>%Cgreen</em></dt>
1837<dd>
1838<p>switch color to green</p>
1839</dd>
1840<dt class="hdlist1"><em>%Cblue</em></dt>
1841<dd>
1842<p>switch color to blue</p>
1843</dd>
1844<dt class="hdlist1"><em>%Creset</em></dt>
1845<dd>
1846<p>reset color</p>
1847</dd>
1848<dt class="hdlist1"><em>%C(&#8230;&#8203;)</em></dt>
1849<dd>
1850<p>color specification, as described under Values in the
1851"CONFIGURATION FILE" section of <a href="git-config.html">git-config(1)</a>. By
1852default, colors are shown only when enabled for log output
1853(by <code>color.diff</code>, <code>color.ui</code>, or <code>--color</code>, and respecting
1854the <code>auto</code> settings of the former if we are going to a
1855terminal). <code>%C(auto,...)</code> is accepted as a historical
1856synonym for the default (e.g., <code>%C(auto,red)</code>). Specifying
1857<code>%C(always,...)</code> will show the colors even when color is
1858not otherwise enabled (though consider just using
1859<code>--color=always</code> to enable color for the whole output,
1860including this format and anything else git might color).
1861<code>auto</code> alone (i.e. <code>%C(auto)</code>) will turn on auto coloring
1862on the next placeholders until the color is switched
1863again.</p>
1864</dd>
1865<dt class="hdlist1"><em>%m</em></dt>
1866<dd>
1867<p>left (<code>&lt;</code>), right (<code>&gt;</code>) or boundary (<code>-</code>) mark</p>
1868</dd>
1869<dt class="hdlist1"><em>%w([&lt;w&gt;[,&lt;i1&gt;[,&lt;i2&gt;]]])</em></dt>
1870<dd>
1871<p>switch line wrapping, like the -w option of
1872<a href="git-shortlog.html">git-shortlog(1)</a>.</p>
1873</dd>
1874<dt class="hdlist1"><em>%&lt;( &lt;N&gt; [,trunc|ltrunc|mtrunc])</em></dt>
1875<dd>
1876<p>make the next placeholder take at
1877least N column widths, padding spaces on
1878the right if necessary. Optionally
1879truncate (with ellipsis <em>..</em>) at the left (ltrunc) <code>..ft</code>,
1880the middle (mtrunc) <code>mi..le</code>, or the end
1881(trunc) <code>rig..</code>, if the output is longer than
1882N columns.
1883Note 1: that truncating
1884only works correctly with N &gt;= 2.
1885Note 2: spaces around the N and M (see below)
1886values are optional.
1887Note 3: Emojis and other wide characters
1888will take two display columns, which may
1889over-run column boundaries.
1890Note 4: decomposed character combining marks
1891may be misplaced at padding boundaries.</p>
1892</dd>
1893<dt class="hdlist1"><em>%&lt;|( &lt;M&gt; )</em></dt>
1894<dd>
1895<p>make the next placeholder take at least until Mth
1896display column, padding spaces on the right if necessary.
1897Use negative M values for column positions measured
1898from the right hand edge of the terminal window.</p>
1899</dd>
1900<dt class="hdlist1"><em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em></dt>
1901<dd>
1902<p>similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em> respectively,
1903but padding spaces on the left</p>
1904</dd>
1905<dt class="hdlist1"><em>%&gt;&gt;( &lt;N&gt; )</em>, <em>%&gt;&gt;|( &lt;M&gt; )</em></dt>
1906<dd>
1907<p>similar to <em>%&gt;( &lt;N&gt; )</em>, <em>%&gt;|( &lt;M&gt; )</em>
1908respectively, except that if the next
1909placeholder takes more spaces than given and
1910there are spaces on its left, use those
1911spaces</p>
1912</dd>
1913<dt class="hdlist1"><em>%&gt;&lt;( &lt;N&gt; )</em>, <em>%&gt;&lt;|( &lt;M&gt; )</em></dt>
1914<dd>
1915<p>similar to <em>%&lt;( &lt;N&gt; )</em>, <em>%&lt;|( &lt;M&gt; )</em>
1916respectively, but padding both sides
1917(i.e. the text is centered)</p>
1918</dd>
1919</dl>
1920</div>
1921</li>
1922<li>
1923<p>Placeholders that expand to information extracted from the commit:</p>
1924<div class="dlist">
1925<dl>
1926<dt class="hdlist1"><em>%H</em></dt>
1927<dd>
1928<p>commit hash</p>
1929</dd>
1930<dt class="hdlist1"><em>%h</em></dt>
1931<dd>
1932<p>abbreviated commit hash</p>
1933</dd>
1934<dt class="hdlist1"><em>%T</em></dt>
1935<dd>
1936<p>tree hash</p>
1937</dd>
1938<dt class="hdlist1"><em>%t</em></dt>
1939<dd>
1940<p>abbreviated tree hash</p>
1941</dd>
1942<dt class="hdlist1"><em>%P</em></dt>
1943<dd>
1944<p>parent hashes</p>
1945</dd>
1946<dt class="hdlist1"><em>%p</em></dt>
1947<dd>
1948<p>abbreviated parent hashes</p>
1949</dd>
1950<dt class="hdlist1"><em>%an</em></dt>
1951<dd>
1952<p>author name</p>
1953</dd>
1954<dt class="hdlist1"><em>%aN</em></dt>
1955<dd>
1956<p>author name (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
1957or <a href="git-blame.html">git-blame(1)</a>)</p>
1958</dd>
1959<dt class="hdlist1"><em>%ae</em></dt>
1960<dd>
1961<p>author email</p>
1962</dd>
1963<dt class="hdlist1"><em>%aE</em></dt>
1964<dd>
1965<p>author email (respecting .mailmap, see <a href="git-shortlog.html">git-shortlog(1)</a>
1966or <a href="git-blame.html">git-blame(1)</a>)</p>
1967</dd>
1968<dt class="hdlist1"><em>%al</em></dt>
1969<dd>
1970<p>author email local-part (the part before the <em>@</em> sign)</p>
1971</dd>
1972<dt class="hdlist1"><em>%aL</em></dt>
1973<dd>
1974<p>author local-part (see <em>%al</em>) respecting .mailmap, see
1975<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
1976</dd>
1977<dt class="hdlist1"><em>%ad</em></dt>
1978<dd>
1979<p>author date (format respects --date= option)</p>
1980</dd>
1981<dt class="hdlist1"><em>%aD</em></dt>
1982<dd>
1983<p>author date, RFC2822 style</p>
1984</dd>
1985<dt class="hdlist1"><em>%ar</em></dt>
1986<dd>
1987<p>author date, relative</p>
1988</dd>
1989<dt class="hdlist1"><em>%at</em></dt>
1990<dd>
1991<p>author date, UNIX timestamp</p>
1992</dd>
1993<dt class="hdlist1"><em>%ai</em></dt>
1994<dd>
1995<p>author date, ISO 8601-like format</p>
1996</dd>
1997<dt class="hdlist1"><em>%aI</em></dt>
1998<dd>
1999<p>author date, strict ISO 8601 format</p>
2000</dd>
2001<dt class="hdlist1"><em>%as</em></dt>
2002<dd>
2003<p>author date, short format (<code>YYYY-MM-DD</code>)</p>
2004</dd>
2005<dt class="hdlist1"><em>%ah</em></dt>
2006<dd>
2007<p>author date, human style (like the <code>--date=human</code> option of
2008<a href="git-rev-list.html">git-rev-list(1)</a>)</p>
2009</dd>
2010<dt class="hdlist1"><em>%cn</em></dt>
2011<dd>
2012<p>committer name</p>
2013</dd>
2014<dt class="hdlist1"><em>%cN</em></dt>
2015<dd>
2016<p>committer name (respecting .mailmap, see
2017<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
2018</dd>
2019<dt class="hdlist1"><em>%ce</em></dt>
2020<dd>
2021<p>committer email</p>
2022</dd>
2023<dt class="hdlist1"><em>%cE</em></dt>
2024<dd>
2025<p>committer email (respecting .mailmap, see
2026<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
2027</dd>
2028<dt class="hdlist1"><em>%cl</em></dt>
2029<dd>
2030<p>committer email local-part (the part before the <em>@</em> sign)</p>
2031</dd>
2032<dt class="hdlist1"><em>%cL</em></dt>
2033<dd>
2034<p>committer local-part (see <em>%cl</em>) respecting .mailmap, see
2035<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
2036</dd>
2037<dt class="hdlist1"><em>%cd</em></dt>
2038<dd>
2039<p>committer date (format respects --date= option)</p>
2040</dd>
2041<dt class="hdlist1"><em>%cD</em></dt>
2042<dd>
2043<p>committer date, RFC2822 style</p>
2044</dd>
2045<dt class="hdlist1"><em>%cr</em></dt>
2046<dd>
2047<p>committer date, relative</p>
2048</dd>
2049<dt class="hdlist1"><em>%ct</em></dt>
2050<dd>
2051<p>committer date, UNIX timestamp</p>
2052</dd>
2053<dt class="hdlist1"><em>%ci</em></dt>
2054<dd>
2055<p>committer date, ISO 8601-like format</p>
2056</dd>
2057<dt class="hdlist1"><em>%cI</em></dt>
2058<dd>
2059<p>committer date, strict ISO 8601 format</p>
2060</dd>
2061<dt class="hdlist1"><em>%cs</em></dt>
2062<dd>
2063<p>committer date, short format (<code>YYYY-MM-DD</code>)</p>
2064</dd>
2065<dt class="hdlist1"><em>%ch</em></dt>
2066<dd>
2067<p>committer date, human style (like the <code>--date=human</code> option of
2068<a href="git-rev-list.html">git-rev-list(1)</a>)</p>
2069</dd>
2070<dt class="hdlist1"><em>%d</em></dt>
2071<dd>
2072<p>ref names, like the --decorate option of <a href="git-log.html">git-log(1)</a></p>
2073</dd>
2074<dt class="hdlist1"><em>%D</em></dt>
2075<dd>
2076<p>ref names without the " (", ")" wrapping.</p>
2077</dd>
2078<dt class="hdlist1"><em>%(decorate[:&lt;options&gt;])</em></dt>
2079<dd>
2080<p>ref names with custom decorations. The <code>decorate</code> string may be followed by a
2081colon and zero or more comma-separated options. Option values may contain
2082literal formatting codes. These must be used for commas (<code>%x2C</code>) and closing
2083parentheses (<code>%x29</code>), due to their role in the option syntax.</p>
2084<div class="ulist">
2085<ul>
2086<li>
2087<p><em>prefix=&lt;value&gt;</em>: Shown before the list of ref names. Defaults to "&#160;<code>(</code>".</p>
2088</li>
2089<li>
2090<p><em>suffix=&lt;value&gt;</em>: Shown after the list of ref names. Defaults to "<code>)</code>".</p>
2091</li>
2092<li>
2093<p><em>separator=&lt;value&gt;</em>: Shown between ref names. Defaults to "<code>,</code>&#160;".</p>
2094</li>
2095<li>
2096<p><em>pointer=&lt;value&gt;</em>: Shown between HEAD and the branch it points to, if any.
2097Defaults to "&#160;<code>-&gt;</code>&#160;".</p>
2098</li>
2099<li>
2100<p><em>tag=&lt;value&gt;</em>: Shown before tag names. Defaults to "<code>tag:</code>&#160;".</p>
2101</li>
2102</ul>
2103</div>
2104</dd>
2105</dl>
2106</div>
2107</li>
2108</ul>
2109</div>
2110<div class="paragraph">
2111<p>For example, to produce decorations with no wrapping
2112or tag annotations, and spaces as separators:</p>
2113</div>
2114<div class="paragraph">
2115<p>+
2116<code>%(decorate:prefix=,suffix=,tag=,separator= )</code></p>
2117</div>
2118<div class="dlist">
2119<dl>
2120<dt class="hdlist1"><em>%(describe[:&lt;options&gt;])</em></dt>
2121<dd>
2122<p>human-readable name, like <a href="git-describe.html">git-describe(1)</a>; empty string for
2123undescribable commits. The <code>describe</code> string may be followed by a colon and
2124zero or more comma-separated options. Descriptions can be inconsistent when
2125tags are added or removed at the same time.</p>
2126<div class="ulist">
2127<ul>
2128<li>
2129<p><em>tags[=&lt;bool-value&gt;]</em>: Instead of only considering annotated tags,
2130consider lightweight tags as well.</p>
2131</li>
2132<li>
2133<p><em>abbrev=&lt;number&gt;</em>: Instead of using the default number of hexadecimal digits
2134(which will vary according to the number of objects in the repository with a
2135default of 7) of the abbreviated object name, use &lt;number&gt; digits, or as many
2136digits as needed to form a unique object name.</p>
2137</li>
2138<li>
2139<p><em>match=&lt;pattern&gt;</em>: Only consider tags matching the given
2140<code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.</p>
2141</li>
2142<li>
2143<p><em>exclude=&lt;pattern&gt;</em>: Do not consider tags matching the given
2144<code>glob(7)</code> pattern, excluding the "refs/tags/" prefix.</p>
2145</li>
2146</ul>
2147</div>
2148</dd>
2149<dt class="hdlist1"><em>%S</em></dt>
2150<dd>
2151<p>ref name given on the command line by which the commit was reached
2152(like <code>git log --source</code>), only works with <code>git log</code></p>
2153</dd>
2154<dt class="hdlist1"><em>%e</em></dt>
2155<dd>
2156<p>encoding</p>
2157</dd>
2158<dt class="hdlist1"><em>%s</em></dt>
2159<dd>
2160<p>subject</p>
2161</dd>
2162<dt class="hdlist1"><em>%f</em></dt>
2163<dd>
2164<p>sanitized subject line, suitable for a filename</p>
2165</dd>
2166<dt class="hdlist1"><em>%b</em></dt>
2167<dd>
2168<p>body</p>
2169</dd>
2170<dt class="hdlist1"><em>%B</em></dt>
2171<dd>
2172<p>raw body (unwrapped subject and body)</p>
2173</dd>
2174<dt class="hdlist1"><em>%N</em></dt>
2175<dd>
2176<p>commit notes</p>
2177</dd>
2178<dt class="hdlist1"><em>%GG</em></dt>
2179<dd>
2180<p>raw verification message from GPG for a signed commit</p>
2181</dd>
2182<dt class="hdlist1"><em>%G?</em></dt>
2183<dd>
2184<p>show "G" for a good (valid) signature,
2185"B" for a bad signature,
2186"U" for a good signature with unknown validity,
2187"X" for a good signature that has expired,
2188"Y" for a good signature made by an expired key,
2189"R" for a good signature made by a revoked key,
2190"E" if the signature cannot be checked (e.g. missing key)
2191and "N" for no signature</p>
2192</dd>
2193<dt class="hdlist1"><em>%GS</em></dt>
2194<dd>
2195<p>show the name of the signer for a signed commit</p>
2196</dd>
2197<dt class="hdlist1"><em>%GK</em></dt>
2198<dd>
2199<p>show the key used to sign a signed commit</p>
2200</dd>
2201<dt class="hdlist1"><em>%GF</em></dt>
2202<dd>
2203<p>show the fingerprint of the key used to sign a signed commit</p>
2204</dd>
2205<dt class="hdlist1"><em>%GP</em></dt>
2206<dd>
2207<p>show the fingerprint of the primary key whose subkey was used
2208to sign a signed commit</p>
2209</dd>
2210<dt class="hdlist1"><em>%GT</em></dt>
2211<dd>
2212<p>show the trust level for the key used to sign a signed commit</p>
2213</dd>
2214<dt class="hdlist1"><em>%gD</em></dt>
2215<dd>
2216<p>reflog selector, e.g., <code>refs/stash@{1}</code> or <code>refs/stash@{2
2217minutes ago}</code>; the format follows the rules described for the
2218<code>-g</code> option. The portion before the <code>@</code> is the refname as
2219given on the command line (so <code>git log -g refs/heads/master</code>
2220would yield <code>refs/heads/master@{0}</code>).</p>
2221</dd>
2222<dt class="hdlist1"><em>%gd</em></dt>
2223<dd>
2224<p>shortened reflog selector; same as <code>%gD</code>, but the refname
2225portion is shortened for human readability (so
2226<code>refs/heads/master</code> becomes just <code>master</code>).</p>
2227</dd>
2228<dt class="hdlist1"><em>%gn</em></dt>
2229<dd>
2230<p>reflog identity name</p>
2231</dd>
2232<dt class="hdlist1"><em>%gN</em></dt>
2233<dd>
2234<p>reflog identity name (respecting .mailmap, see
2235<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
2236</dd>
2237<dt class="hdlist1"><em>%ge</em></dt>
2238<dd>
2239<p>reflog identity email</p>
2240</dd>
2241<dt class="hdlist1"><em>%gE</em></dt>
2242<dd>
2243<p>reflog identity email (respecting .mailmap, see
2244<a href="git-shortlog.html">git-shortlog(1)</a> or <a href="git-blame.html">git-blame(1)</a>)</p>
2245</dd>
2246<dt class="hdlist1"><em>%gs</em></dt>
2247<dd>
2248<p>reflog subject</p>
2249</dd>
2250<dt class="hdlist1"><em>%(trailers[:&lt;options&gt;])</em></dt>
2251<dd>
2252<p>display the trailers of the body as interpreted by
2253<a href="git-interpret-trailers.html">git-interpret-trailers(1)</a>. The <code>trailers</code> string may be followed by
2254a colon and zero or more comma-separated options. If any option is provided
2255multiple times, the last occurrence wins.</p>
2256<div class="ulist">
2257<ul>
2258<li>
2259<p><em>key=&lt;key&gt;</em>: only show trailers with specified &lt;key&gt;. Matching is done
2260case-insensitively and trailing colon is optional. If option is
2261given multiple times trailer lines matching any of the keys are
2262shown. This option automatically enables the <code>only</code> option so that
2263non-trailer lines in the trailer block are hidden. If that is not
2264desired it can be disabled with <code>only=false</code>. E.g.,
2265<code>%(trailers:key=Reviewed-by)</code> shows trailer lines with key
2266<code>Reviewed-by</code>.</p>
2267</li>
2268<li>
2269<p><em>only[=&lt;bool&gt;]</em>: select whether non-trailer lines from the trailer
2270block should be included.</p>
2271</li>
2272<li>
2273<p><em>separator=&lt;sep&gt;</em>: specify the separator inserted between trailer
2274lines. Defaults to a line feed character. The string &lt;sep&gt; may contain
2275the literal formatting codes described above. To use comma as
2276separator one must use <code>%x2C</code> as it would otherwise be parsed as
2277next option. E.g., <code>%(trailers:key=Ticket,separator=%x2C )</code>
2278shows all trailer lines whose key is "Ticket" separated by a comma
2279and a space.</p>
2280</li>
2281<li>
2282<p><em>unfold[=&lt;bool&gt;]</em>: make it behave as if interpret-trailer&#8217;s <code>--unfold</code>
2283option was given. E.g.,
2284<code>%(trailers:only,unfold=true)</code> unfolds and shows all trailer lines.</p>
2285</li>
2286<li>
2287<p><em>keyonly[=&lt;bool&gt;]</em>: only show the key part of the trailer.</p>
2288</li>
2289<li>
2290<p><em>valueonly[=&lt;bool&gt;]</em>: only show the value part of the trailer.</p>
2291</li>
2292<li>
2293<p><em>key_value_separator=&lt;sep&gt;</em>: specify the separator inserted between
2294the key and value of each trailer. Defaults to ": ". Otherwise it
2295shares the same semantics as <em>separator=&lt;sep&gt;</em> above.</p>
2296</li>
2297</ul>
2298</div>
2299</dd>
2300</dl>
2301</div>
2302</li>
2303</ul>
2304</div>
2305<div class="admonitionblock note">
2306<table>
2307<tr>
2308<td class="icon">
2309<div class="title">Note</div>
2310</td>
2311<td class="content">
2312Some placeholders may depend on other options given to the
2313revision traversal engine. For example, the <code>%g*</code> reflog options will
2314insert an empty string unless we are traversing reflog entries (e.g., by
2315<code>git log -g</code>). The <code>%d</code> and <code>%D</code> placeholders will use the "short"
2316decoration format if <code>--decorate</code> was not already provided on the command
2317line.
2318</td>
2319</tr>
2320</table>
2321</div>
2322<div class="paragraph">
2323<p>The boolean options accept an optional value <code>[=&lt;bool-value&gt;]</code>. The values
2324<code>true</code>, <code>false</code>, <code>on</code>, <code>off</code> etc. are all accepted. See the "boolean"
2325sub-section in "EXAMPLES" in <a href="git-config.html">git-config(1)</a>. If a boolean
2326option is given with no value, it&#8217;s enabled.</p>
2327</div>
2328<div class="paragraph">
2329<p>If you add a <code>+</code> (plus sign) after <em>%</em> of a placeholder, a line-feed
2330is inserted immediately before the expansion if and only if the
2331placeholder expands to a non-empty string.</p>
2332</div>
2333<div class="paragraph">
2334<p>If you add a <code>-</code> (minus sign) after <em>%</em> of a placeholder, all consecutive
2335line-feeds immediately preceding the expansion are deleted if and only if the
2336placeholder expands to an empty string.</p>
2337</div>
2338<div class="paragraph">
2339<p>If you add a ` ` (space) after <em>%</em> of a placeholder, a space
2340is inserted immediately before the expansion if and only if the
2341placeholder expands to a non-empty string.</p>
2342</div>
2343<div class="ulist">
2344<ul>
2345<li>
2346<p><em>tformat:</em></p>
2347<div class="paragraph">
2348<p>The <em>tformat:</em> format works exactly like <em>format:</em>, except that it
2349provides "terminator" semantics instead of "separator" semantics. In
2350other words, each commit has the message terminator character (usually a
2351newline) appended, rather than a separator placed between entries.
2352This means that the final entry of a single-line format will be properly
2353terminated with a new line, just as the "oneline" format does.
2354For example:</p>
2355</div>
2356<div class="listingblock">
2357<div class="content">
2358<pre>$ git log -2 --pretty=format:%h 4da45bef \
2359 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
23604da45be
23617134973 -- NO NEWLINE
2362
2363$ git log -2 --pretty=tformat:%h 4da45bef \
2364 | perl -pe '$_ .= " -- NO NEWLINE\n" unless /\n/'
23654da45be
23667134973</pre>
2367</div>
2368</div>
2369<div class="paragraph">
2370<p>In addition, any unrecognized string that has a <code>%</code> in it is interpreted
2371as if it has <code>tformat:</code> in front of it. For example, these two are
2372equivalent:</p>
2373</div>
2374<div class="listingblock">
2375<div class="content">
2376<pre>$ git log -2 --pretty=tformat:%h 4da45bef
2377$ git log -2 --pretty=%h 4da45bef</pre>
2378</div>
2379</div>
2380</li>
2381</ul>
2382</div>
2383</div>
2384</div>
2385<div class="sect1">
2386<h2 id="_raw_output_format">Raw output format</h2>
2387<div class="sectionbody">
2388<div class="paragraph">
2389<p>The raw output format from "git-diff-index", "git-diff-tree",
2390"git-diff-files" and "git diff --raw" are very similar.</p>
2391</div>
2392<div class="paragraph">
2393<p>These commands all compare two sets of things; what is
2394compared differs:</p>
2395</div>
2396<div class="dlist">
2397<dl>
2398<dt class="hdlist1">git-diff-index &lt;tree-ish&gt;</dt>
2399<dd>
2400<p>compares the &lt;tree-ish&gt; and the files on the filesystem.</p>
2401</dd>
2402<dt class="hdlist1">git-diff-index --cached &lt;tree-ish&gt;</dt>
2403<dd>
2404<p>compares the &lt;tree-ish&gt; and the index.</p>
2405</dd>
2406<dt class="hdlist1">git-diff-tree [-r] &lt;tree-ish-1&gt; &lt;tree-ish-2&gt; [&lt;pattern&gt;&#8230;&#8203;]</dt>
2407<dd>
2408<p>compares the trees named by the two arguments.</p>
2409</dd>
2410<dt class="hdlist1">git-diff-files [&lt;pattern&gt;&#8230;&#8203;]</dt>
2411<dd>
2412<p>compares the index and the files on the filesystem.</p>
2413</dd>
2414</dl>
2415</div>
2416<div class="paragraph">
2417<p>The "git-diff-tree" command begins its output by printing the hash of
2418what is being compared. After that, all the commands print one output
2419line per changed file.</p>
2420</div>
2421<div class="paragraph">
2422<p>An output line is formatted this way:</p>
2423</div>
2424<div class="listingblock">
2425<div class="content">
2426<pre>in-place edit :100644 100644 bcd1234 0123456 M file0
2427copy-edit :100644 100644 abcd123 1234567 C68 file1 file2
2428rename-edit :100644 100644 abcd123 1234567 R86 file1 file3
2429create :000000 100644 0000000 1234567 A file4
2430delete :100644 000000 1234567 0000000 D file5
2431unmerged :000000 000000 0000000 0000000 U file6</pre>
2432</div>
2433</div>
2434<div class="paragraph">
2435<p>That is, from the left to the right:</p>
2436</div>
2437<div class="olist arabic">
2438<ol class="arabic">
2439<li>
2440<p>a colon.</p>
2441</li>
2442<li>
2443<p>mode for "src"; 000000 if creation or unmerged.</p>
2444</li>
2445<li>
2446<p>a space.</p>
2447</li>
2448<li>
2449<p>mode for "dst"; 000000 if deletion or unmerged.</p>
2450</li>
2451<li>
2452<p>a space.</p>
2453</li>
2454<li>
2455<p>sha1 for "src"; 0{40} if creation or unmerged.</p>
2456</li>
2457<li>
2458<p>a space.</p>
2459</li>
2460<li>
2461<p>sha1 for "dst"; 0{40} if deletion, unmerged or "work tree out of sync with the index".</p>
2462</li>
2463<li>
2464<p>a space.</p>
2465</li>
2466<li>
2467<p>status, followed by optional "score" number.</p>
2468</li>
2469<li>
2470<p>a tab or a NUL when <code>-z</code> option is used.</p>
2471</li>
2472<li>
2473<p>path for "src"</p>
2474</li>
2475<li>
2476<p>a tab or a NUL when <code>-z</code> option is used; only exists for C or R.</p>
2477</li>
2478<li>
2479<p>path for "dst"; only exists for C or R.</p>
2480</li>
2481<li>
2482<p>an LF or a NUL when <code>-z</code> option is used, to terminate the record.</p>
2483</li>
2484</ol>
2485</div>
2486<div class="paragraph">
2487<p>Possible status letters are:</p>
2488</div>
2489<div class="ulist">
2490<ul>
2491<li>
2492<p>A: addition of a file</p>
2493</li>
2494<li>
2495<p>C: copy of a file into a new one</p>
2496</li>
2497<li>
2498<p>D: deletion of a file</p>
2499</li>
2500<li>
2501<p>M: modification of the contents or mode of a file</p>
2502</li>
2503<li>
2504<p>R: renaming of a file</p>
2505</li>
2506<li>
2507<p>T: change in the type of the file (regular file, symbolic link or submodule)</p>
2508</li>
2509<li>
2510<p>U: file is unmerged (you must complete the merge before it can
2511be committed)</p>
2512</li>
2513<li>
2514<p>X: "unknown" change type (most probably a bug, please report it)</p>
2515</li>
2516</ul>
2517</div>
2518<div class="paragraph">
2519<p>Status letters C and R are always followed by a score (denoting the
2520percentage of similarity between the source and target of the move or
2521copy). Status letter M may be followed by a score (denoting the
2522percentage of dissimilarity) for file rewrites.</p>
2523</div>
2524<div class="paragraph">
2525<p>The sha1 for "dst" is shown as all 0&#8217;s if a file on the filesystem
2526is out of sync with the index.</p>
2527</div>
2528<div class="paragraph">
2529<p>Example:</p>
2530</div>
2531<div class="listingblock">
2532<div class="content">
2533<pre>:100644 100644 5be4a4a 0000000 M file.c</pre>
2534</div>
2535</div>
2536<div class="paragraph">
2537<p>Without the <code>-z</code> option, pathnames with "unusual" characters are
2538quoted as explained for the configuration variable <code>core.quotePath</code>
2539(see <a href="git-config.html">git-config(1)</a>). Using <code>-z</code> the filename is output
2540verbatim and the line is terminated by a NUL byte.</p>
2541</div>
2542</div>
2543</div>
2544<div class="sect1">
2545<h2 id="_diff_format_for_merges">diff format for merges</h2>
2546<div class="sectionbody">
2547<div class="paragraph">
2548<p>"git-diff-tree", "git-diff-files" and "git-diff --raw"
2549can take <code>-c</code> or <code>--cc</code> option
2550to generate diff output also for merge commits. The output differs
2551from the format described above in the following way:</p>
2552</div>
2553<div class="olist arabic">
2554<ol class="arabic">
2555<li>
2556<p>there is a colon for each parent</p>
2557</li>
2558<li>
2559<p>there are more "src" modes and "src" sha1</p>
2560</li>
2561<li>
2562<p>status is concatenated status characters for each parent</p>
2563</li>
2564<li>
2565<p>no optional "score" number</p>
2566</li>
2567<li>
2568<p>tab-separated pathname(s) of the file</p>
2569</li>
2570</ol>
2571</div>
2572<div class="paragraph">
2573<p>For <code>-c</code> and <code>--cc</code>, only the destination or final path is shown even
2574if the file was renamed on any side of history. With
2575<code>--combined-all-paths</code>, the name of the path in each parent is shown
2576followed by the name of the path in the merge commit.</p>
2577</div>
2578<div class="paragraph">
2579<p>Examples for <code>-c</code> and <code>--cc</code> without <code>--combined-all-paths</code>:</p>
2580</div>
2581<div class="listingblock">
2582<div class="content">
2583<pre>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c
2584::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM bar.sh
2585::100644 100644 100644 e07d6c5 9042e82 ee91881 RR phooey.c</pre>
2586</div>
2587</div>
2588<div class="paragraph">
2589<p>Examples when <code>--combined-all-paths</code> added to either <code>-c</code> or <code>--cc</code>:</p>
2590</div>
2591<div class="listingblock">
2592<div class="content">
2593<pre>::100644 100644 100644 fabadb8 cc95eb0 4866510 MM desc.c desc.c desc.c
2594::100755 100755 100755 52b7a2d 6d1ac04 d2ac7d7 RM foo.sh bar.sh bar.sh
2595::100644 100644 100644 e07d6c5 9042e82 ee91881 RR fooey.c fuey.c phooey.c</pre>
2596</div>
2597</div>
2598<div class="paragraph">
2599<p>Note that <em>combined diff</em> lists only files which were modified from
2600all parents.</p>
2601</div>
2602</div>
2603</div>
2604<div class="sect1">
2605<h2 id="generate_patch_text_with_p">Generating patch text with -p</h2>
2606<div class="sectionbody">
2607<div class="paragraph">
2608<p>Running
2609<a href="git-diff.html">git-diff(1)</a>,
2610<a href="git-log.html">git-log(1)</a>,
2611<a href="git-show.html">git-show(1)</a>,
2612<a href="git-diff-index.html">git-diff-index(1)</a>,
2613<a href="git-diff-tree.html">git-diff-tree(1)</a>, or
2614<a href="git-diff-files.html">git-diff-files(1)</a>
2615with the <code>-p</code> option produces patch text.
2616You can customize the creation of patch text via the
2617<code>GIT_EXTERNAL_DIFF</code> and the <code>GIT_DIFF_OPTS</code> environment variables
2618(see <a href="git.html">git(1)</a>), and the <code>diff</code> attribute (see <a href="gitattributes.html">gitattributes(5)</a>).</p>
2619</div>
2620<div class="paragraph">
2621<p>What the -p option produces is slightly different from the traditional
2622diff format:</p>
2623</div>
2624<div class="olist arabic">
2625<ol class="arabic">
2626<li>
2627<p>It is preceded by a "git diff" header that looks like this:</p>
2628<div class="literalblock">
2629<div class="content">
2630<pre>diff --git a/file1 b/file2</pre>
2631</div>
2632</div>
2633<div class="paragraph">
2634<p>The <code>a/</code> and <code>b/</code> filenames are the same unless rename/copy is
2635involved. Especially, even for a creation or a deletion,
2636<code>/dev/null</code> is <em>not</em> used in place of the <code>a/</code> or <code>b/</code> filenames.</p>
2637</div>
2638<div class="paragraph">
2639<p>When a rename/copy is involved, <code>file1</code> and <code>file2</code> show the
2640name of the source file of the rename/copy and the name of
2641the file that the rename/copy produces, respectively.</p>
2642</div>
2643</li>
2644<li>
2645<p>It is followed by one or more extended header lines:</p>
2646<div class="literalblock">
2647<div class="content">
2648<pre>old mode &lt;mode&gt;
2649new mode &lt;mode&gt;
2650deleted file mode &lt;mode&gt;
2651new file mode &lt;mode&gt;
2652copy from &lt;path&gt;
2653copy to &lt;path&gt;
2654rename from &lt;path&gt;
2655rename to &lt;path&gt;
2656similarity index &lt;number&gt;
2657dissimilarity index &lt;number&gt;
2658index &lt;hash&gt;..&lt;hash&gt; &lt;mode&gt;</pre>
2659</div>
2660</div>
2661<div class="paragraph">
2662<p>File modes are printed as 6-digit octal numbers including the file type
2663and file permission bits.</p>
2664</div>
2665<div class="paragraph">
2666<p>Path names in extended headers do not include the <code>a/</code> and <code>b/</code> prefixes.</p>
2667</div>
2668<div class="paragraph">
2669<p>The similarity index is the percentage of unchanged lines, and
2670the dissimilarity index is the percentage of changed lines. It
2671is a rounded down integer, followed by a percent sign. The
2672similarity index value of 100% is thus reserved for two equal
2673files, while 100% dissimilarity means that no line from the old
2674file made it into the new one.</p>
2675</div>
2676<div class="paragraph">
2677<p>The index line includes the blob object names before and after the change.
2678The &lt;mode&gt; is included if the file mode does not change; otherwise,
2679separate lines indicate the old and the new mode.</p>
2680</div>
2681</li>
2682<li>
2683<p>Pathnames with "unusual" characters are quoted as explained for
2684the configuration variable <code>core.quotePath</code> (see
2685<a href="git-config.html">git-config(1)</a>).</p>
2686</li>
2687<li>
2688<p>All the <code>file1</code> files in the output refer to files before the
2689commit, and all the <code>file2</code> files refer to files after the commit.
2690It is incorrect to apply each change to each file sequentially. For
2691example, this patch will swap a and b:</p>
2692<div class="literalblock">
2693<div class="content">
2694<pre>diff --git a/a b/b
2695rename from a
2696rename to b
2697diff --git a/b b/a
2698rename from b
2699rename to a</pre>
2700</div>
2701</div>
2702</li>
2703<li>
2704<p>Hunk headers mention the name of the function to which the hunk
2705applies. See "Defining a custom hunk-header" in
2706<a href="gitattributes.html">gitattributes(5)</a> for details of how to tailor this to
2707specific languages.</p>
2708</li>
2709</ol>
2710</div>
2711</div>
2712</div>
2713<div class="sect1">
2714<h2 id="_combined_diff_format">Combined diff format</h2>
2715<div class="sectionbody">
2716<div class="paragraph">
2717<p>Any diff-generating command can take the <code>-c</code> or <code>--cc</code> option to
2718produce a <em>combined diff</em> when showing a merge. This is the default
2719format when showing merges with <a href="git-diff.html">git-diff(1)</a> or
2720<a href="git-show.html">git-show(1)</a>. Note also that you can give suitable
2721<code>--diff-merges</code> option to any of these commands to force generation of
2722diffs in a specific format.</p>
2723</div>
2724<div class="paragraph">
2725<p>A "combined diff" format looks like this:</p>
2726</div>
2727<div class="listingblock">
2728<div class="content">
2729<pre>diff --combined describe.c
2730index fabadb8,cc95eb0..4866510
2731--- a/describe.c
2732+++ b/describe.c
2733@@@ -98,20 -98,12 +98,20 @@@
2734 return (a_date &gt; b_date) ? -1 : (a_date == b_date) ? 0 : 1;
2735 }
2736
2737- static void describe(char *arg)
2738 -static void describe(struct commit *cmit, int last_one)
2739++static void describe(char *arg, int last_one)
2740 {
2741 + unsigned char sha1[20];
2742 + struct commit *cmit;
2743 struct commit_list *list;
2744 static int initialized = 0;
2745 struct commit_name *n;
2746
2747 + if (get_sha1(arg, sha1) &lt; 0)
2748 + usage(describe_usage);
2749 + cmit = lookup_commit_reference(sha1);
2750 + if (!cmit)
2751 + usage(describe_usage);
2752 +
2753 if (!initialized) {
2754 initialized = 1;
2755 for_each_ref(get_name);</pre>
2756</div>
2757</div>
2758<div class="olist arabic">
2759<ol class="arabic">
2760<li>
2761<p>It is preceded by a "git diff" header, that looks like
2762this (when the <code>-c</code> option is used):</p>
2763<div class="literalblock">
2764<div class="content">
2765<pre>diff --combined file</pre>
2766</div>
2767</div>
2768<div class="paragraph">
2769<p>or like this (when the <code>--cc</code> option is used):</p>
2770</div>
2771<div class="literalblock">
2772<div class="content">
2773<pre>diff --cc file</pre>
2774</div>
2775</div>
2776</li>
2777<li>
2778<p>It is followed by one or more extended header lines
2779(this example shows a merge with two parents):</p>
2780<div class="literalblock">
2781<div class="content">
2782<pre>index &lt;hash&gt;,&lt;hash&gt;..&lt;hash&gt;
2783mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;
2784new file mode &lt;mode&gt;
2785deleted file mode &lt;mode&gt;,&lt;mode&gt;</pre>
2786</div>
2787</div>
2788<div class="paragraph">
2789<p>The <code>mode &lt;mode&gt;,&lt;mode&gt;..&lt;mode&gt;</code> line appears only if at least one of
2790the &lt;mode&gt; is different from the rest. Extended headers with
2791information about detected content movement (renames and
2792copying detection) are designed to work with the diff of two
2793&lt;tree-ish&gt; and are not used by combined diff format.</p>
2794</div>
2795</li>
2796<li>
2797<p>It is followed by a two-line from-file/to-file header:</p>
2798<div class="literalblock">
2799<div class="content">
2800<pre>--- a/file
2801+++ b/file</pre>
2802</div>
2803</div>
2804<div class="paragraph">
2805<p>Similar to the two-line header for the traditional <em>unified</em> diff
2806format, <code>/dev/null</code> is used to signal created or deleted
2807files.</p>
2808</div>
2809<div class="paragraph">
2810<p>However, if the --combined-all-paths option is provided, instead of a
2811two-line from-file/to-file, you get an N+1 line from-file/to-file header,
2812where N is the number of parents in the merge commit:</p>
2813</div>
2814<div class="literalblock">
2815<div class="content">
2816<pre>--- a/file
2817--- a/file
2818--- a/file
2819+++ b/file</pre>
2820</div>
2821</div>
2822<div class="paragraph">
2823<p>This extended format can be useful if rename or copy detection is
2824active, to allow you to see the original name of the file in different
2825parents.</p>
2826</div>
2827</li>
2828<li>
2829<p>Chunk header format is modified to prevent people from
2830accidentally feeding it to <code>patch -p1</code>. Combined diff format
2831was created for review of merge commit changes, and was not
2832meant to be applied. The change is similar to the change in the
2833extended <em>index</em> header:</p>
2834<div class="literalblock">
2835<div class="content">
2836<pre>@@@ &lt;from-file-range&gt; &lt;from-file-range&gt; &lt;to-file-range&gt; @@@</pre>
2837</div>
2838</div>
2839<div class="paragraph">
2840<p>There are (number of parents + 1) <code>@</code> characters in the chunk
2841header for combined diff format.</p>
2842</div>
2843</li>
2844</ol>
2845</div>
2846<div class="paragraph">
2847<p>Unlike the traditional <em>unified</em> diff format, which shows two
2848files A and B with a single column that has <code>-</code> (minus&#8201;&#8212;&#8201;appears in A but removed in B), <code>+</code> (plus&#8201;&#8212;&#8201;missing in A but
2849added to B), or <code>" "</code> (space&#8201;&#8212;&#8201;unchanged) prefix, this format
2850compares two or more files file1, file2,&#8230;&#8203; with one file X, and
2851shows how X differs from each of fileN. One column for each of
2852fileN is prepended to the output line to note how X&#8217;s line is
2853different from it.</p>
2854</div>
2855<div class="paragraph">
2856<p>A <code>-</code> character in the column N means that the line appears in
2857fileN but it does not appear in the result. A <code>+</code> character
2858in the column N means that the line appears in the result,
2859and fileN does not have that line (in other words, the line was
2860added, from the point of view of that parent).</p>
2861</div>
2862<div class="paragraph">
2863<p>In the above example output, the function signature was changed
2864from both files (hence two <code>-</code> removals from both file1 and
2865file2, plus <code>++</code> to mean one line that was added does not appear
2866in either file1 or file2). Also, eight other lines are the same
2867from file1 but do not appear in file2 (hence prefixed with <code>+</code>).</p>
2868</div>
2869<div class="paragraph">
2870<p>When shown by <code>git diff-tree -c</code>, it compares the parents of a
2871merge commit with the merge result (i.e. file1..fileN are the
2872parents). When shown by <code>git diff-files -c</code>, it compares the
2873two unresolved merge parents with the working tree file
2874(i.e. file1 is stage 2 aka "our version", file2 is stage 3 aka
2875"their version").</p>
2876</div>
2877</div>
2878</div>
2879<div class="sect1">
2880<h2 id="_other_diff_formats">other diff formats</h2>
2881<div class="sectionbody">
2882<div class="paragraph">
2883<p>The <code>--summary</code> option describes newly added, deleted, renamed and
2884copied files. The <code>--stat</code> option adds diffstat(1) graph to the
2885output. These options can be combined with other options, such as
2886<code>-p</code>, and are meant for human consumption.</p>
2887</div>
2888<div class="paragraph">
2889<p>When showing a change that involves a rename or a copy, <code>--stat</code> output
2890formats the pathnames compactly by combining common prefix and suffix of
2891the pathnames. For example, a change that moves <code>arch/i386/Makefile</code> to
2892<code>arch/x86/Makefile</code> while modifying 4 lines will be shown like this:</p>
2893</div>
2894<div class="listingblock">
2895<div class="content">
2896<pre>arch/{i386 =&gt; x86}/Makefile | 4 +--</pre>
2897</div>
2898</div>
2899<div class="paragraph">
2900<p>The <code>--numstat</code> option gives the diffstat(1) information but is designed
2901for easier machine consumption. An entry in <code>--numstat</code> output looks
2902like this:</p>
2903</div>
2904<div class="listingblock">
2905<div class="content">
2906<pre>1 2 README
29073 1 arch/{i386 =&gt; x86}/Makefile</pre>
2908</div>
2909</div>
2910<div class="paragraph">
2911<p>That is, from left to right:</p>
2912</div>
2913<div class="olist arabic">
2914<ol class="arabic">
2915<li>
2916<p>the number of added lines;</p>
2917</li>
2918<li>
2919<p>a tab;</p>
2920</li>
2921<li>
2922<p>the number of deleted lines;</p>
2923</li>
2924<li>
2925<p>a tab;</p>
2926</li>
2927<li>
2928<p>pathname (possibly with rename/copy information);</p>
2929</li>
2930<li>
2931<p>a newline.</p>
2932</li>
2933</ol>
2934</div>
2935<div class="paragraph">
2936<p>When <code>-z</code> output option is in effect, the output is formatted this way:</p>
2937</div>
2938<div class="listingblock">
2939<div class="content">
2940<pre>1 2 README NUL
29413 1 NUL arch/i386/Makefile NUL arch/x86/Makefile NUL</pre>
2942</div>
2943</div>
2944<div class="paragraph">
2945<p>That is:</p>
2946</div>
2947<div class="olist arabic">
2948<ol class="arabic">
2949<li>
2950<p>the number of added lines;</p>
2951</li>
2952<li>
2953<p>a tab;</p>
2954</li>
2955<li>
2956<p>the number of deleted lines;</p>
2957</li>
2958<li>
2959<p>a tab;</p>
2960</li>
2961<li>
2962<p>a NUL (only exists if renamed/copied);</p>
2963</li>
2964<li>
2965<p>pathname in preimage;</p>
2966</li>
2967<li>
2968<p>a NUL (only exists if renamed/copied);</p>
2969</li>
2970<li>
2971<p>pathname in postimage (only exists if renamed/copied);</p>
2972</li>
2973<li>
2974<p>a NUL.</p>
2975</li>
2976</ol>
2977</div>
2978<div class="paragraph">
2979<p>The extra <code>NUL</code> before the preimage path in renamed case is to allow
2980scripts that read the output to tell if the current record being read is
2981a single-path record or a rename/copy record without reading ahead.
2982After reading added and deleted lines, reading up to <code>NUL</code> would yield
2983the pathname, but if that is <code>NUL</code>, the record will show two paths.</p>
2984</div>
2985</div>
2986</div>
2987<div class="sect1">
2988<h2 id="_git">GIT</h2>
2989<div class="sectionbody">
2990<div class="paragraph">
2991<p>Part of the <a href="git.html">git(1)</a> suite</p>
2992</div>
2993</div>
2994</div>
2995</div>
2996<div id="footer">
2997<div id="footer-text">
Junio C Hamano902ce172024-08-21 21:02:372998Last updated 2024-08-21 14:01:26 -0700
Junio C Hamanob96f40a2024-08-01 00:57:252999</div>
3000</div>
3001</body>
3002</html>